public class ExoMedia
extends java.lang.Object
com.google.android.exoplayer2.Renderers and
com.google.android.exoplayer2.source.MediaSources| Modifier and Type | Class and Description |
|---|---|
static class |
ExoMedia.Data |
static interface |
ExoMedia.DataSourceFactoryProvider |
static interface |
ExoMedia.HttpDataSourceFactoryProvider
Deprecated.
Use
ExoMedia.DataSourceFactoryProvider instead |
static class |
ExoMedia.RendererType |
| Constructor and Description |
|---|
ExoMedia() |
| Modifier and Type | Method and Description |
|---|---|
static void |
registerMediaSourceBuilder(MediaSourceProvider.SourceTypeBuilder builder)
Registers additional
com.google.android.exoplayer2.source.MediaSources for the specified file
extensions (and regexes). |
static void |
registerRenderer(ExoMedia.RendererType type,
java.lang.Class<? extends Renderer> clazz)
Registers additional customized
com.google.android.exoplayer2.Renderers
that will be used by the com.google.android.exoplayer2.source.MediaSources to
correctly play media. |
static void |
setDataSourceFactoryProvider(ExoMedia.DataSourceFactoryProvider provider)
Specifies the provider to use when building
com.google.android.exoplayer2.upstream.DataSource.Factory
instances for use with the MediaSourceBuilders. |
static void |
setHttpDataSourceFactoryProvider(ExoMedia.HttpDataSourceFactoryProvider provider)
Deprecated.
Use
setDataSourceFactoryProvider(DataSourceFactoryProvider) instead as it is more permissive |
static void |
setLoadControl(LoadControl loadControl)
Specifies the
LoadControl to use when building the com.google.android.exoplayer2.ExoPlayer instance
used in the VideoView and AudioPlayer. |
public static void registerRenderer(ExoMedia.RendererType type, java.lang.Class<? extends Renderer> clazz)
com.google.android.exoplayer2.Renderers
that will be used by the com.google.android.exoplayer2.source.MediaSources to
correctly play media.type - The type for the rendererclazz - The class of the customized Rendererpublic static void registerMediaSourceBuilder(MediaSourceProvider.SourceTypeBuilder builder)
com.google.android.exoplayer2.source.MediaSources for the specified file
extensions (and regexes). com.google.android.exoplayer2.source.MediaSources registered here will take
precedence to the pre-configured ones.builder - The builder for additional or customized media sources@Deprecated public static void setHttpDataSourceFactoryProvider(ExoMedia.HttpDataSourceFactoryProvider provider)
setDataSourceFactoryProvider(DataSourceFactoryProvider) instead as it is more permissivecom.google.android.exoplayer2.upstream.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 setDataSourceFactoryProvider(ExoMedia.DataSourceFactoryProvider provider)
com.google.android.exoplayer2.upstream.DataSource.Factory
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(LoadControl loadControl)
LoadControl to use when building the com.google.android.exoplayer2.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
com.google.android.exoplayer2.DefaultLoadControl. When the loadControl is null
the default instance of the com.google.android.exoplayer2.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 com.google.android.exoplayer2.ExoPlayer instances