public class ExoMedia
extends java.lang.Object
Renderers and
MediaSources| Modifier and Type | Class and Description |
|---|---|
static class |
ExoMedia.Data |
static interface |
ExoMedia.HttpDataSourceFactoryProvider |
static class |
ExoMedia.RendererType |
| Constructor and Description |
|---|
ExoMedia() |
| Modifier and Type | Method and Description |
|---|---|
static void |
registerMediaSourceBuilder(MediaSourceProvider.SourceTypeBuilder builder)
Registers additional
MediaSources for the specified file
extensions (and regexes). |
static void |
registerRenderer(ExoMedia.RendererType type,
java.lang.Class<? super com.google.android.exoplayer2.Renderer> clazz)
Registers additional customized
Renderers
that will be used by the MediaSources to
correctly play media. |
static void |
setHttpDataSourceFactoryProvider(ExoMedia.HttpDataSourceFactoryProvider provider)
Specifies the provider to use when building
HttpDataSource.BaseFactory
instances for use with the MediaSourceBuilders. |
static void |
setLoadControl(com.google.android.exoplayer2.LoadControl loadControl)
Specifies the
LoadControl to use when building the ExoPlayer instance
used in the VideoView and AudioPlayer. |
public static void registerRenderer(@NonNull
ExoMedia.RendererType type,
@NonNull
java.lang.Class<? super com.google.android.exoplayer2.Renderer> clazz)
Renderers
that will be used by the MediaSources to
correctly play media.type - The type for the rendererclazz - The class of the customized Rendererpublic static void registerMediaSourceBuilder(@NonNull
MediaSourceProvider.SourceTypeBuilder builder)
MediaSources for the specified file
extensions (and regexes). MediaSources registered here will take
precedence to the pre-configured ones.builder - The builder for additional or customized media sourcespublic static void setHttpDataSourceFactoryProvider(@Nullable
ExoMedia.HttpDataSourceFactoryProvider provider)
HttpDataSource.BaseFactory
instances for use with the MediaSourceBuilders. This will
only be used for builders that haven't customized the MediaSourceBuilder.buildDataSourceFactory(Context, String, TransferListener)
method.provider - The provider to use for the MediaSourceBuilderspublic static void setLoadControl(@Nullable
com.google.android.exoplayer2.LoadControl loadControl)
LoadControl to use when building the ExoPlayer instance
used in the VideoView and AudioPlayer. This allows the
buffering amounts to be modified to better suit your needs which can be easily specified by using an instance of
DefaultLoadControl. When the loadControl is null
the default instance of the DefaultLoadControl will be used. This will only
take effect for any instances created after this was set.loadControl - The LoadControl to use for any new ExoPlayer instances