public final class ExoPlayerFactory
extends java.lang.Object
ExoPlayer
instances.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_ALLOWED_VIDEO_JOINING_TIME_MS
The default maximum duration for which a video renderer can attempt to seamlessly join an
ongoing playback.
|
Modifier and Type | Method and Description |
---|---|
static ExoPlayer |
newInstance(Renderer[] renderers,
TrackSelector trackSelector)
Creates an
ExoPlayer instance. |
static ExoPlayer |
newInstance(Renderer[] renderers,
TrackSelector trackSelector,
LoadControl loadControl)
Creates an
ExoPlayer instance. |
static SimpleExoPlayer |
newSimpleInstance(android.content.Context context,
TrackSelector trackSelector,
LoadControl loadControl)
Creates a
SimpleExoPlayer instance. |
static SimpleExoPlayer |
newSimpleInstance(android.content.Context context,
TrackSelector trackSelector,
LoadControl loadControl,
DrmSessionManager drmSessionManager)
Creates a
SimpleExoPlayer instance. |
static SimpleExoPlayer |
newSimpleInstance(android.content.Context context,
TrackSelector trackSelector,
LoadControl loadControl,
DrmSessionManager drmSessionManager,
boolean preferExtensionDecoders)
Creates a
SimpleExoPlayer instance. |
static SimpleExoPlayer |
newSimpleInstance(android.content.Context context,
TrackSelector trackSelector,
LoadControl loadControl,
DrmSessionManager drmSessionManager,
boolean preferExtensionDecoders,
long allowedVideoJoiningTimeMs)
Creates a
SimpleExoPlayer instance. |
public static final long DEFAULT_ALLOWED_VIDEO_JOINING_TIME_MS
public static SimpleExoPlayer newSimpleInstance(android.content.Context context, TrackSelector trackSelector, LoadControl loadControl)
SimpleExoPlayer
instance. Must be called from a thread that has an associated
Looper
.context
- A Context
.trackSelector
- The TrackSelector
that will be used by the instance.loadControl
- The LoadControl
that will be used by the instance.public static SimpleExoPlayer newSimpleInstance(android.content.Context context, TrackSelector trackSelector, LoadControl loadControl, DrmSessionManager drmSessionManager)
SimpleExoPlayer
instance. Must be called from a thread that has an associated
Looper
.context
- A Context
.trackSelector
- The TrackSelector
that will be used by the instance.loadControl
- The LoadControl
that will be used by the instance.drmSessionManager
- An optional DrmSessionManager
. May be null if the instance
will not be used for DRM protected playbacks.public static SimpleExoPlayer newSimpleInstance(android.content.Context context, TrackSelector trackSelector, LoadControl loadControl, DrmSessionManager drmSessionManager, boolean preferExtensionDecoders)
SimpleExoPlayer
instance. Must be called from a thread that has an associated
Looper
.context
- A Context
.trackSelector
- The TrackSelector
that will be used by the instance.loadControl
- The LoadControl
that will be used by the instance.drmSessionManager
- An optional DrmSessionManager
. May be null if the instance
will not be used for DRM protected playbacks.preferExtensionDecoders
- True to prefer Renderer
instances defined in
available extensions over those defined in the core library. Note that extensions must be
included in the application build for setting this flag to have any effect.public static SimpleExoPlayer newSimpleInstance(android.content.Context context, TrackSelector trackSelector, LoadControl loadControl, DrmSessionManager drmSessionManager, boolean preferExtensionDecoders, long allowedVideoJoiningTimeMs)
SimpleExoPlayer
instance. Must be called from a thread that has an associated
Looper
.context
- A Context
.trackSelector
- The TrackSelector
that will be used by the instance.loadControl
- The LoadControl
that will be used by the instance.drmSessionManager
- An optional DrmSessionManager
. May be null if the instance
will not be used for DRM protected playbacks.preferExtensionDecoders
- True to prefer Renderer
instances defined in
available extensions over those defined in the core library. Note that extensions must be
included in the application build for setting this flag to have any effect.allowedVideoJoiningTimeMs
- The maximum duration for which a video renderer can attempt to
seamlessly join an ongoing playback.public static ExoPlayer newInstance(Renderer[] renderers, TrackSelector trackSelector)
ExoPlayer
instance. Must be called from a thread that has an associated
Looper
.renderers
- The Renderer
s that will be used by the instance.trackSelector
- The TrackSelector
that will be used by the instance.public static ExoPlayer newInstance(Renderer[] renderers, TrackSelector trackSelector, LoadControl loadControl)
ExoPlayer
instance. Must be called from a thread that has an associated
Looper
.renderers
- The Renderer
s that will be used by the instance.trackSelector
- The TrackSelector
that will be used by the instance.loadControl
- The LoadControl
that will be used by the instance.