-
- All Implemented Interfaces:
-
com.brightcove.player.event.Component
@Emits(events = {EventType.ADD_ANALYTICS_BASE_PARAMS, EventType.ANALYTICS_VIDEO_ENGAGEMENT, EventType.AUDIO_TRACKS, EventType.BUFFERING_COMPLETED, EventType.BUFFERING_STARTED, EventType.ERROR, EventType.SEEK_TO_INCORRECT_TARGET_VALUE})@ListensFor(events = {EventType.SELECT_AUDIO_TRACK, EventType.SELECT_CLOSED_CAPTION_TRACK, EventType.ON_FRAME_AVAILABLE, EventType.VIDEO_DURATION_CHANGED, EventType.DID_SET_ANALYTICS_BASE_PARAMS}) public class ExoPlayerVideoDisplayComponent extends VideoDisplayComponent
This class extends the VideoDisplayComponent to add support for the ExoPlayer.
See: https://github.com/google/ExoPlayer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interface
ExoPlayerVideoDisplayComponent.TrackType
The list of possible Format types.
public interface
ExoPlayerVideoDisplayComponent.Id3MetadataListener
public interface
ExoPlayerVideoDisplayComponent.MetadataListener
Listener for receiving Metadata parsed from the media stream.
public interface
ExoPlayerVideoDisplayComponent.InternalErrorListener
Listeners for receiving error information.
public interface
ExoPlayerVideoDisplayComponent.CaptionListener
A listener for receiving notifications of timed text.
public interface
ExoPlayerVideoDisplayComponent.InfoListener
A listener for debugging information.
-
Field Summary
Fields Modifier and Type Field Description public final static String
BUFFERED_POSITION
public final static String
RENDITION_CHANGED
public final static String
EXOPLAYER_FORMAT
public final static String
IN_MANIFEST_CC_URI_STR
public final static String
UNKNOWN_CC
public final static int
TYPE_VIDEO
public final static int
TYPE_AUDIO
public final static int
TYPE_TEXT
public final static int
TYPE_METADATA
public static ResourceBundle
resourceBundle
private ExoMediaPlayback
playback
private ExoPlayerVideoDisplayComponent.Id3MetadataListener
id3MetadataListener
private ExoPlayerVideoDisplayComponent.MetadataListener
metadataListener
private TextInformationFrameListener
textInformationFrameListener
-
Constructor Summary
Constructors Constructor Description ExoPlayerVideoDisplayComponent(RenderView renderView, EventEmitter eventEmitter)
-
Method Summary
Modifier and Type Method Description ExoMediaPlayback
getPlayback()
ExoPlayerVideoDisplayComponent.Id3MetadataListener
getId3MetadataListener()
ExoPlayerVideoDisplayComponent.MetadataListener
getMetadataListener()
void
setMetadataListener(ExoPlayerVideoDisplayComponent.MetadataListener listener)
TextInformationFrameListener
getTextInformationFrameListener()
void
setTextInformationFrameListener(@NonNull() TextInformationFrameListener listener)
BrightcoveDrmSession
getBrightcoveDrmSession()
Deprecates. ExoPlayerDrmSessionManager
getExoPlayerDrmSessionManager()
Gets the ExoPlayer Drm session if available or null otherwise. WidevineMediaDrmCallback
getWidevineMediaDrmCallback()
ExoMediaPlayback
onCreatePlayback()
ExoMediaPlayback
createPlayback()
void
setPlaybackNotification(PlaybackNotification playbackNotification)
PlaybackNotification
getPlaybackNotification()
Video
getCurrentVideo()
Source
getCurrentSource()
DefaultTrackSelector
getTrackSelector()
Gets the DefaultTrackSelector object. TrackSelectorHelper
getTrackSelectorHelper()
Gets the TrackSelectorHelper object. void
setTrackSelector(@NonNull() DefaultTrackSelector trackSelector)
MediaPlayer
getMediaPlayer()
boolean
hasDvr()
boolean
isLive()
boolean
isInLiveEdge()
long
getPlayerCurrentPosition()
int
getLiveEdge()
Deprecated. ExoPlayer
getExoPlayer()
long
getLiveEdgeLong()
Compute the "live edge" as a long datatype, the largest position not within three target durations of the duration (per the HLS spec). int
getPlayerState()
Returns the ExoPlayer state if available,or -1 if the player is null. void
setDebugListener(ExoPlayerVideoDisplayComponent.InfoListener debugListener)
void
setCaptionListener(ExoPlayerVideoDisplayComponent.CaptionListener listener)
void
setInternalErrorListener(ExoPlayerVideoDisplayComponent.InternalErrorListener internalErrorListener)
Looper
getPlaybackLooper()
Handler
getMainHandler()
Format
getVideoFormat()
int
getPeakBitrate()
Return the peak bitrate. void
setPeakBitrate(int peakBitrate)
Sets the peak bitrate.Set 0 to set the default bitrate. void
setVideoSelectionOverrideCreator(@NonNull() SelectionOverrideCreator videoSelectionOverrideCreator)
Provides a creator for a DefaultTrackSelector.SelectionOverride instance specific for the Video track. void
setVideoTrackSelectionOverrideCreator(@NonNull() TrackSelectionOverrideCreator videoTrackSelectionOverrideCreator)
Provides a creator for a com.google.android.exoplayer2.trackselection.TrackSelectionOverride instance specific for the Video track. BandwidthMeter
getBandwidthMeter()
Returns the current bandwidth meter. void
setBandwidthMeter(BandwidthMeter bandwidthMeter)
Sets the current bandwidth meter. HttpDataSource.Factory
getDataSourceFactory()
Returns the current HttpDataSource.Factory, which is used when creating the MediaSource. void
setDataSourceFactory(@NonNull() HttpDataSource.Factory httpDataSourceFactory)
Sets the HttpDataSource.Factory, which is used when creating the MediaSource.WARNING: When creating a customized HttpDataSource. long
getMinBufferDurationToSwitchUp()
Returns the minimum duration of media that needs to be bufferedfor a switch to a higher quality variant to be considered. void
setMinBufferDurationToSwitchUp(long minBufferDurationToSwitchUp)
Sets the minimum duration of media that needs to be bufferedfor a switch to a higher quality variant to be considered. long
getMaxBufferDurationToSwitchDown()
Returns the maximum duration of media that needs to be bufferedfor a switch to a lower quality variant to be considered. void
setMaxBufferDurationToSwitchDown(long maxBufferDurationToSwitchDown)
Sets the maximum duration of media that needs to be bufferedfor a switch to a lower quality variant to be considered. int
getMinBufferMs()
Returns the minimum duration of data that must be buffered forplayback to start or resume following a user action such as aseek. void
setMinBufferMs(int minBufferMs)
Sets the minimum duration of data that must be buffered forplayback to start or resume following a user action such as aseek. int
getMinRebufferMs()
void
setMinRebufferMs(int minRebufferMs)
LoadControlConfig
getLoadControlConfig()
Gets the LoadControlConfig object. void
setLoadControlConfig(@NonNull() LoadControlConfig loadControlConfig)
Sets the LoadControlConfig object. void
surfaceCreated(SurfaceHolder surfaceHolder)
void
surfaceChanged(SurfaceHolder surfaceHolder, int format, int w, int h)
void
surfaceDestroyed(SurfaceHolder surfaceHolder)
boolean
isCurrentMediaAudioOnly()
Map<String, String>
getVideoDisplayProperties()
void
setVideoDisplayProperties(Map<String, String> videoDisplayProperties)
boolean
getAllowHlsChunklessPreparation()
void
setAllowHlsChunklessPreparation(boolean allowHlsChunklessPreparation)
The value of this field in the HlsMediaSource defaults to true in ExoPlayer 2.17. boolean
getUseDrmSessionsForClearContent()
void
setUseDrmSessionsForClearContent(boolean useDrmSessionsForClearContent)
Whether to use the DRM session with clear content sections in the media(e.g. void
setConnectAndReadTimeoutMs(int connectTimeoutOverrideMs, int readTimeoutOverrideMs)
Set the Connect and Read timeout override valuesSetting these values will create a new com.google.android.exoplayer2.upstream.DefaultHttpDataSource.Factory withthese override values, and set it in the ExoMediaPlaybackIt is recommended to use override values that are equal to each other, and greater than: DEFAULT_CONNECT_TIMEOUT_MILLISDEFAULT_READ_TIMEOUT_MILLIS DefaultRenderersFactory
getDefaultRenderersFactory()
Gets the DefaultRenderersFactory object. void
setDefaultRenderersFactory(@NonNull() DefaultRenderersFactory defaultRenderersFactory)
void
setMediaStore(MediaStore mediaStore)
Set the {MediaStore} for offline playback support -
Methods inherited from class com.brightcove.player.display.VideoDisplayComponent
createPlayback, getAnalytics, getCurrentSource, getCurrentSourceOrFail, getCurrentVideo, getCurrentVideoOrFail, getLiveEdge, getLiveEdgeLong, getMediaPlayer, getPlayback, getPlayerCurrentPosition, getRenderView, hasDvr, isCurrentMediaAudioOnly, isCurrentVideo360Mode, isInLiveEdge, isLive, onSurfaceTextureAvailable, onSurfaceTextureDestroyed, onSurfaceTextureSizeChanged, onSurfaceTextureUpdated, setProgressInterval, setRendererConfig, setShouldPlayAudioOnlyInBackground, setTextInformationFrameListener, shouldPlayAudioOnlyInBackground, surfaceChanged, surfaceCreated, surfaceDestroyed
-
Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getPlayback
ExoMediaPlayback getPlayback()
-
getId3MetadataListener
ExoPlayerVideoDisplayComponent.Id3MetadataListener getId3MetadataListener()
-
getMetadataListener
ExoPlayerVideoDisplayComponent.MetadataListener getMetadataListener()
-
setMetadataListener
void setMetadataListener(ExoPlayerVideoDisplayComponent.MetadataListener listener)
-
getTextInformationFrameListener
@NonNull() TextInformationFrameListener getTextInformationFrameListener()
-
setTextInformationFrameListener
void setTextInformationFrameListener(@NonNull() TextInformationFrameListener listener)
-
getBrightcoveDrmSession
@Nullable()@Deprecated() BrightcoveDrmSession getBrightcoveDrmSession()
Deprecates. Instead use {getExoPlayerDrmSessionManager}
-
getExoPlayerDrmSessionManager
ExoPlayerDrmSessionManager getExoPlayerDrmSessionManager()
Gets the ExoPlayer Drm session if available or null otherwise.The ExoPlayerDrmSessionManager will be created only when the current Source properties has the key WIDEVINE_KEY_SYSTEM
-
getWidevineMediaDrmCallback
WidevineMediaDrmCallback getWidevineMediaDrmCallback()
-
onCreatePlayback
ExoMediaPlayback onCreatePlayback()
-
createPlayback
ExoMediaPlayback createPlayback()
-
setPlaybackNotification
void setPlaybackNotification(PlaybackNotification playbackNotification)
-
getPlaybackNotification
PlaybackNotification getPlaybackNotification()
-
getCurrentVideo
@Nullable() Video getCurrentVideo()
-
getCurrentSource
@Nullable() Source getCurrentSource()
-
getTrackSelector
@Nullable() DefaultTrackSelector getTrackSelector()
Gets the DefaultTrackSelector object.
-
getTrackSelectorHelper
@Nullable() TrackSelectorHelper getTrackSelectorHelper()
Gets the TrackSelectorHelper object.
-
setTrackSelector
void setTrackSelector(@NonNull() DefaultTrackSelector trackSelector)
-
getMediaPlayer
MediaPlayer getMediaPlayer()
-
hasDvr
boolean hasDvr()
-
isLive
boolean isLive()
-
isInLiveEdge
boolean isInLiveEdge()
-
getPlayerCurrentPosition
long getPlayerCurrentPosition()
-
getLiveEdge
@Deprecated() int getLiveEdge()
Deprecated. Instead use getLiveEdgeLong
-
getExoPlayer
ExoPlayer getExoPlayer()
-
getLiveEdgeLong
long getLiveEdgeLong()
Compute the "live edge" as a long datatype, the largest position not within three target durations of the duration (per the HLS spec).
-
getPlayerState
int getPlayerState()
Returns the ExoPlayer state if available,or -1 if the player is null.
-
setDebugListener
void setDebugListener(ExoPlayerVideoDisplayComponent.InfoListener debugListener)
-
setCaptionListener
void setCaptionListener(ExoPlayerVideoDisplayComponent.CaptionListener listener)
-
setInternalErrorListener
void setInternalErrorListener(ExoPlayerVideoDisplayComponent.InternalErrorListener internalErrorListener)
-
getPlaybackLooper
Looper getPlaybackLooper()
-
getMainHandler
Handler getMainHandler()
-
getVideoFormat
Format getVideoFormat()
-
getPeakBitrate
int getPeakBitrate()
Return the peak bitrate.
-
setPeakBitrate
void setPeakBitrate(int peakBitrate)
Sets the peak bitrate.Set 0 to set the default bitrate.
- Parameters:
peakBitrate
- the peak bitrate
-
setVideoSelectionOverrideCreator
@Deprecated() void setVideoSelectionOverrideCreator(@NonNull() SelectionOverrideCreator videoSelectionOverrideCreator)
Provides a creator for a DefaultTrackSelector.SelectionOverride instance specific for the Video track.This SelectionOverride is applied every time a new video is loaded, and when the setPeakBitrate is set.
If you want to disable the default SelectionOverride, you may pass EMPTY, which returns EMPTY_SELECTION_OVERRIDE and gets ignored when attempting to apply it to the DefaultTrackSelector.
-
setVideoTrackSelectionOverrideCreator
void setVideoTrackSelectionOverrideCreator(@NonNull() TrackSelectionOverrideCreator videoTrackSelectionOverrideCreator)
Provides a creator for a com.google.android.exoplayer2.trackselection.TrackSelectionOverride instance specific for the Video track.This TrackSelectionOverride is applied every time a new video is loaded, and when the setPeakBitrate is set.
If you want to disable the default TrackSelectionOverride, you may pass EMPTY, which returns EMPTY_TRACK_SELECTION_OVERRIDES and gets ignored when attempting to apply it to the DefaultTrackSelector.
-
getBandwidthMeter
BandwidthMeter getBandwidthMeter()
Returns the current bandwidth meter. If null, a defaultbandwidth meter will be used.
-
setBandwidthMeter
void setBandwidthMeter(BandwidthMeter bandwidthMeter)
Sets the current bandwidth meter.
-
getDataSourceFactory
@NonNull() HttpDataSource.Factory getDataSourceFactory()
Returns the current HttpDataSource.Factory, which is used when creating the MediaSource.
-
setDataSourceFactory
void setDataSourceFactory(@NonNull() HttpDataSource.Factory httpDataSourceFactory)
Sets the HttpDataSource.Factory, which is used when creating the MediaSource.WARNING: When creating a customized HttpDataSource.Factory, you must make sure to use the defaultuser agent HTTP_USER_AGENT to avoid losing Brightcove Analyticsand Delivery Rules support.
- Parameters:
httpDataSourceFactory
- the http data source factory
-
getMinBufferDurationToSwitchUp
@Deprecated() long getMinBufferDurationToSwitchUp()
Returns the minimum duration of media that needs to be bufferedfor a switch to a higher quality variant to be considered.
-
setMinBufferDurationToSwitchUp
@Deprecated() void setMinBufferDurationToSwitchUp(long minBufferDurationToSwitchUp)
Sets the minimum duration of media that needs to be bufferedfor a switch to a higher quality variant to be considered.
-
getMaxBufferDurationToSwitchDown
@Deprecated() long getMaxBufferDurationToSwitchDown()
Returns the maximum duration of media that needs to be bufferedfor a switch to a lower quality variant to be considered.
-
setMaxBufferDurationToSwitchDown
@Deprecated() void setMaxBufferDurationToSwitchDown(long maxBufferDurationToSwitchDown)
Sets the maximum duration of media that needs to be bufferedfor a switch to a lower quality variant to be considered.
-
getMinBufferMs
@Deprecated() int getMinBufferMs()
Returns the minimum duration of data that must be buffered forplayback to start or resume following a user action such as aseek.
-
setMinBufferMs
@Deprecated() void setMinBufferMs(int minBufferMs)
Sets the minimum duration of data that must be buffered forplayback to start or resume following a user action such as aseek.
-
getMinRebufferMs
@Deprecated() int getMinRebufferMs()
-
setMinRebufferMs
@Deprecated() void setMinRebufferMs(int minRebufferMs)
-
getLoadControlConfig
LoadControlConfig getLoadControlConfig()
Gets the LoadControlConfig object.
-
setLoadControlConfig
void setLoadControlConfig(@NonNull() LoadControlConfig loadControlConfig)
Sets the LoadControlConfig object.
This object is used to create a LoadControl instance.The LoadControl is used when creating an instance of the ExoPlayer.
- Parameters:
loadControlConfig
- the load control config
-
surfaceCreated
void surfaceCreated(SurfaceHolder surfaceHolder)
-
surfaceChanged
void surfaceChanged(SurfaceHolder surfaceHolder, int format, int w, int h)
-
surfaceDestroyed
void surfaceDestroyed(SurfaceHolder surfaceHolder)
-
isCurrentMediaAudioOnly
boolean isCurrentMediaAudioOnly()
-
getVideoDisplayProperties
Map<String, String> getVideoDisplayProperties()
-
setVideoDisplayProperties
void setVideoDisplayProperties(Map<String, String> videoDisplayProperties)
-
getAllowHlsChunklessPreparation
boolean getAllowHlsChunklessPreparation()
-
setAllowHlsChunklessPreparation
void setAllowHlsChunklessPreparation(boolean allowHlsChunklessPreparation)
The value of this field in the HlsMediaSource defaults to true in ExoPlayer 2.17.0Override it here to false if your HLS delivery includes 608/708 captions
-
getUseDrmSessionsForClearContent
boolean getUseDrmSessionsForClearContent()
-
setUseDrmSessionsForClearContent
void setUseDrmSessionsForClearContent(boolean useDrmSessionsForClearContent)
Whether to use the DRM session with clear content sections in the media(e.g. for DRM content with clear stitched-in ads)
-
setConnectAndReadTimeoutMs
void setConnectAndReadTimeoutMs(int connectTimeoutOverrideMs, int readTimeoutOverrideMs)
Set the Connect and Read timeout override valuesSetting these values will create a new com.google.android.exoplayer2.upstream.DefaultHttpDataSource.Factory withthese override values, and set it in the ExoMediaPlaybackIt is recommended to use override values that are equal to each other, and greater than: DEFAULT_CONNECT_TIMEOUT_MILLISDEFAULT_READ_TIMEOUT_MILLIS
-
getDefaultRenderersFactory
@Nullable() DefaultRenderersFactory getDefaultRenderersFactory()
Gets the DefaultRenderersFactory object.
-
setDefaultRenderersFactory
void setDefaultRenderersFactory(@NonNull() DefaultRenderersFactory defaultRenderersFactory)
-
setMediaStore
void setMediaStore(MediaStore mediaStore)
Set the {MediaStore} for offline playback support
- Parameters:
mediaStore
- - The MediaStore
-
-
-
-