Package com.brightcove.player.controller
Class VideoPlaybackController
java.lang.Object
com.brightcove.player.event.AbstractComponent
com.brightcove.player.controller.VideoPlaybackController
- All Implemented Interfaces:
Component
@Emits(events={"completed","cuePoint","didSelectSource","didSetVideo","play","selectSource","setSource","setVideoStill"})
@ListensFor(events={"completed","cuePoint","seekTo","didSeekTo","didSetSource","play","didPlay","progress","readyToPlay","removeCuePoint","setCuePoint","setCuePoints","setVideo","willChangeVideo"})
public class VideoPlaybackController
extends AbstractComponent
implements Component
Manages video playback and provides proper translation between the Brightcove representation
of videos and the underlying platform's representation. This includes performing activities such
as selecting the appropriate rendition to play, given a Video object, and ensuring that a Video
still image loads properly if specified in a Video object.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
protected class
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Disables ad playback which otherwise might occurr after a -seekTo.protected int
static final String
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
ConstructorDescriptionVideoPlaybackController
(EventEmitter eventEmitter) Being a Component, VideoPlaybackController requires an EventEmitter on initialization. -
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.boolean
Indicates whether there are pending Sources to load.void
Resets the state of the controller to its initial values.protected void
Ensure that all relevant event listeners are registered with the EventEmitter given in the constructor.boolean
void
setAdsDisabled
(boolean disable) void
setLiveWindowTimeMs
(int liveWindowTimeMs) Deprecated.setShouldSelectSource
(boolean shouldSelectSource) Set whether the controller selects the source or if this is handled by another component.Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Field Details
-
TAG
-
adsDisabled
protected boolean adsDisabledDisables ad playback which otherwise might occurr after a -seekTo. The intended use is, for example, to resume video playback when an app has quit and relaunched; the app can seek to a saved time and ads which have been previously viewed will not play again. Set adsDisabled to true, then call -seekTo method, and then set adsDisabled to false in the DID_SEEK_TO listener callback. The default value of adsDisabled is false. -
liveWindowTimeMs
protected int liveWindowTimeMs
-
-
Constructor Details
-
VideoPlaybackController
Being a Component, VideoPlaybackController requires an EventEmitter on initialization.- Parameters:
eventEmitter
- the EventEmitter through which this Component will listen for and emit events to interact with other components in the player
-
-
Method Details
-
isAdsDisabled
public boolean isAdsDisabled() -
setAdsDisabled
public void setAdsDisabled(boolean disable) -
getLiveWindowTimeMs
Deprecated.Gets the time in milliseconds for the Live Stream Window. Currently used only for UI.- Returns:
- the live window time in ms
-
setLiveWindowTimeMs
Deprecated.Sets the time in milliseconds for the Live Stream Window. Currently used only for UI.- Parameters:
liveWindowTimeMs
- the live window time in ms
-
setShouldSelectSource
Set whether the controller selects the source or if this is handled by another component. This is set to true by default.- Parameters:
shouldSelectSource
- True to allow the controller to publish source and video events.
-
initialize
public void initialize()Resets the state of the controller to its initial values. This is automatically called by the constructor, but can be called again if new components are introduced to the given EventEmitter. This will also clear out any pending SET_SOURCE events that might have happened if one was to be emitted before READY_TO_PLAY was received. -
hasPendingSourcesToLoad
public boolean hasPendingSourcesToLoad()Indicates whether there are pending Sources to load.- Returns:
- true if there are Sources to load (resulting from SELECT_SOURCE responses happening before PLAYER_LOAD fired), false otherwise
-
initializeListeners
protected void initializeListeners()Ensure that all relevant event listeners are registered with the EventEmitter given in the constructor.
-