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.
  • Field Details

    • TAG

      public static final String TAG
    • adsDisabled

      protected boolean adsDisabled
      Disables 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

      public VideoPlaybackController(EventEmitter eventEmitter)
      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 public int 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 public void setLiveWindowTimeMs(int liveWindowTimeMs)
      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

      public VideoPlaybackController setShouldSelectSource(boolean shouldSelectSource)
      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.