This topic describes the model for the events dispatched by the VideoPlayer and VideoDisplay components. With the Brightcove 3.2 release, we have deprecated the events formerly dispatched by the VideoPlayer and VideoDisplay components (though these deprecated events will still available to ensure backwards compatibility). Instead, Brightcove provides new MediaEvents. The MediaEvents have been put in place to provide consistency in the event behavior of progressive download and streaming content. Just like the deprecated VideoEvents, MediaEvents contain position and duration properties as well as a media property that holds a reference to the MediaDTO for which the event was dispatched. We encourage you to use these new events instead of the old video events going forward.
For more information about changes in the Player API in Brightcove 3.2, see Brightcove Player API Changes. For reference information about events in the Player API, see the API Reference. For a list of the deprecated events, see Deprecated events below.
| string type | constant in Player API SWC constant in JavaScript API |
description |
|---|---|---|
| "mediaChange" | MediaEvent.CHANGE BCMediaEvent.CHANGE |
Dispatched when new media is loaded or cued in the video player. |
| "mediaBegin" | MediaEvent.BEGIN BCMediaEvent.BEGIN |
Dispatched when the media begins playing the first time, post buffer. This is the equivalent to the old "streamStart" and should be used for any tracking purposes. It will only be dispatched once for a media object, so not on replay (unless the media is loaded a second time after another piece of media is played in between). |
| "mediaComplete" | MediaEvent.COMPLETE BCMediaEvent.COMPLETE |
Dispatched with the media completes playback. This will only be fired once per piece of media (unless the media is loaded and completed a second time after another piece of media is played in between). |
| "mediaPlay" | MediaEvent.PLAY BCMediaEvent.PLAY |
Dispatched whenever media playback is begun initially or resumed after pause. |
| "mediaStop" | MediaEvent.STOP BCMediaEvent.STOP |
Dispatched whenever media is paused, and upon final completion of the media if the media has been previously completed (in which case, COMPLETE is not fired a second time). |
| "mediaBufferBegin" | MediaEvent.BUFFER_BEGIN BCMediaEvent.BUFFER_BEGIN |
Dispatched whenever the media pauses to buffer. |
| "mediaBufferComplete" | MediaEvent.BUFFER_COMPLETE BCMediaEvent.BUFFER_COMPLETE |
Dispatched whenever the media completes buffering. This will always be paired with a BUFFER_BEGIN event with no events in between. |
| "mediaSeek" | MediaEvent.SEEK BCMediaEvent.SEEK |
Dispatched whenever media is sent to a new position through the API's seek() method or because the user dragged the playhead. |
| "mediaProgress" | MediaEvent.PROGRESS BCMediaEvent.PROGRESS |
Dispatched every frame while the media is playing. |
| "mediaError" | MediaEvent.ERROR BCMediaEvent.ERROR |
Dispatched if there is an error connecting to or loading media. |
| "mediaVolumeChange" | MediaEvent.VOLUME_CHANGE BCMediaEvent.VOLUME_CHANGE |
Dispatched whenever the volume of the media is changed, through either the API's setVolume() method or through the user dragging a volume control. |
| "mediaMuteChange" | MediaEvent.MUTE_CHANGE BCMediaEvent.MUTE_CHANGE |
Dispatched whenever the mute setting of the player changes (muted or unmuted), through either the API's mute() method or through the user clicking the mute control. |
The MediaEvents have the following expected behaviors:
There are only a few known exceptions to the consistency of events for the different types of media and media playback.
The following events in the VideoPlayer Module have been deprecated. Use the new MediaEvents instead.
videoChange
videoLoad
streamStart
videoComplete
videoStart
videoStop
startBuffering
endBuffering
seek
videoProgress
volumeChange
mute