cast.
framework
.
events
This is the cast.framework.events
namespace.
Classes
BitrateChangedEvent
Event data for a cast.framework.events.EventType.BITRATE_CHANGED
event.
BreaksEvent
Event data for all events pertaining to breaks: cast.framework.events.EventType.BREAK_ENDED
, cast.framework.events.EventType.BREAK_STARTED
, cast.framework.events.EventType.BREAK_CLIP_ENDED
, cast.framework.events.EventType.BREAK_CLIP_LOADING
, and cast.framework.events.EventType.BREAK_CLIP_STARTED
BufferingEvent
Event data for the cast.framework.events.EventType.BUFFERING
event.
CacheItemEvent
Event data for a cast.framework.events.EventType.CACHE_HIT
event or a cast.framework.events.EventType.CACHE_INSERTED
event.
CacheLoadedEvent
Event data for a cast.framework.events.EventType.CACHE_LOADED
event.
ClipEndedEvent
Event data for the cast.framework.events.EventType.CLIP_ENDED
event.
CustomStateEvent
Event data for a cast.framework.events.EventType.CUSTOM_STATE
event.
EmsgEvent
Event data for a cast.framework.events.EventType.EMSG
event.
ErrorEvent
Event data for a cast.framework.events.EventType.ERROR
event.
Event
Event data superclass for all events dispatched by cast.framework.PlayerManager .
Id3Event
Event data for a cast.framework.events.EventType.ID3
event.
The ID3 metadata provided here follows the ID3 v2 formatting.
One event is fired per frame within the ID3 message.
This event does NOT contain the entire, raw ID3 message. Given the following
subsections of an ID3 message:
- ID3v2 / file identifier
- ID3v2 version
- ID3v2 flags
- ID3v2 size
- Frame type (i.e.
TXXX
) - Frame size
- Frame flags
- Frame encoding
- Frame description
- Frame data
Only items 5
( frameType
), 9
( frameDescription
), and 10
( segmentData
) are provided in this event.
LiveStatusEvent
Event data for a cast.framework.events.EventType.LIVE_IS_MOVING_WINDOW_CHANGED
event or a cast.framework.events.EventType.LIVE_ENDED
event.
LoadEvent
Event data for all events pertaining to processing a load or preload request. made to the player.
MediaElementEvent
Event data for all events forwarded from the MediaElement
.
MediaFinishedEvent
Event data for a cast.framework.events.EventType.MEDIA_FINISHED
event.
MediaInformationChangedEvent
Event data for a cast.framework.events.EventType.MEDIA_INFORMATION_CHANGED
event.
MediaPauseEvent
Event data for pause
events forwarded from the MediaElement
.
MediaStatusEvent
Event data for a cast.framework.events.EventType.MEDIA_STATUS
event.
RequestEvent
Event data for all events that represent requests made to the receiver.
SegmentDownloadedEvent
Event data for a cast.framework.events.EventType.SEGMENT_DOWNLOADED
event.
TimedMetadataEvent
Event data superclass for timed metadata events. This differs from Id3Event
in that the metadata is held at the manifest as opposed to segment internals.
TracksChangedEvent
Event data for a cast.framework.events.EventType.TRACKS_CHANGED
event.
Namespace
category
Enumerations
DetailedErrorCode
number
Detailed Error code
Value
MEDIA_UNKNOWN
number
Returned when the HTMLMediaElement throws an error, but CAF does not recognize the specific error.
MEDIA_ABORTED
number
Returned when the fetching process for the media resource was aborted by the user agent at the user's request.
MEDIA_DECODE
number
Returned when an error occurred while decoding the media resource, after the resource was established to be usable.
MEDIA_NETWORK
number
Returned when a network error caused the user agent to stop fetching the media resource, after the resource was established to be usable.
MEDIA_SRC_NOT_SUPPORTED
number
Returned when the media resource indicated by the src attribute was not suitable.
SOURCE_BUFFER_FAILURE
number
Returned when a source buffer cannot be added to the MediaSource.
MEDIAKEYS_UNKNOWN
number
Returned when there is an unknown error with media keys.
MEDIAKEYS_NETWORK
number
Returned when there is a media keys failure due to a network issue.
MEDIAKEYS_UNSUPPORTED
number
Returned when a MediaKeySession object cannot be created.
MEDIAKEYS_WEBCRYPTO
number
Returned when crypto failed.
NETWORK_UNKNOWN
number
Returned when there was an unknown network issue.
SEGMENT_NETWORK
number
Returned when a segment fails to download.
HLS_NETWORK_MASTER_PLAYLIST
number
Returned when an HLS master playlist fails to download.
HLS_NETWORK_PLAYLIST
number
Returned when an HLS playlist fails to download.
HLS_NETWORK_NO_KEY_RESPONSE
number
Returned when an HLS key fails to download.
HLS_NETWORK_KEY_LOAD
number
Returned when a request for an HLS key fails before it is sent.
HLS_NETWORK_INVALID_SEGMENT
number
Returned when an HLS segment is invalid.
HLS_SEGMENT_PARSING
number
Returned when an HLS segment fails to parse.
DASH_NETWORK
number
Returned when an unknown network error occurs while handling a DASH stream.
DASH_NO_INIT
number
Returned when a DASH stream is missing an init.
SMOOTH_NETWORK
number
Returned when an unknown network error occurs while handling a Smooth stream.
SMOOTH_NO_MEDIA_DATA
number
Returned when a Smooth stream is missing media data.
MANIFEST_UNKNOWN
number
Returned when an unknown error occurs while parsing a manifest.
HLS_MANIFEST_MASTER
number
Returned when an error occurs while parsing an HLS master manifest.
HLS_MANIFEST_PLAYLIST
number
Returned when an error occurs while parsing an HLS playlist.
DASH_MANIFEST_UNKNOWN
number
Returned when an unknown error occurs while parsing a DASH manifest.
DASH_MANIFEST_NO_PERIODS
number
Returned when a DASH manifest is missing periods.
DASH_MANIFEST_NO_MIMETYPE
number
Returned when a DASH manifest is missing a MimeType.
DASH_INVALID_SEGMENT_INFO
number
Returned when a DASH manifest contains invalid segment info.
SMOOTH_MANIFEST
number
Returned when an error occurs while parsing a Smooth manifest.
SEGMENT_UNKNOWN
number
Returned when an unknown segment error occurs.
TEXT_UNKNOWN
number
An unknown error occurred with a text stream.
APP
number
Returned when an error occurs outside of the framework (e.g., if an event handler throws an error).
BREAK_CLIP_LOADING_ERROR
number
Returned when break clip load interceptor fails.
BREAK_SEEK_INTERCEPTOR_ERROR
number
Returned when break seek interceptor fails.
IMAGE_ERROR
number
Returned when an image fails to load.
LOAD_INTERRUPTED
number
A load was interrupted by an unload, or by another load.
LOAD_FAILED
number
A load command failed.
MEDIA_ERROR_MESSAGE
number
An error message was sent to the sender.
GENERIC
number
Returned when an unknown error occurs.
EndedReason
string
Reasons for how playback ends.
Value
END_OF_STREAM
string
Playback ended because we reach the end of current stream.
ERROR
string
Playback ended because we encountered an error.
STOPPED
string
Playback ended because an operation forces us to stop the current stream.
INTERRUPTED
string
Playback ended because of a new loaded item.
SKIPPED
string
Playback ended because of a skip ad operation.
BREAK_SWITCH
string
Playback ended because of switching stitched break.
ErrorSeverity
number
The error severity. Follows the same naming scheme and numbering as Shaka Player.
Value
RECOVERABLE
number
An error occurred, but the Player is attempting to recover from the error. If the Player cannot ultimately recover, it still may not throw a CRITICAL error. For example, retrying for a media segment will never result in a CRITICAL error (the Player will just retry forever).
CRITICAL
number
A critical error that the player cannot recover from. These cause player to stop the playback for the current media item.
EventType
string
Player event types. For events that are proxied from the MediaElement, see https://dev.w3.org/html5/spec-preview/media-elements.html#mediaevents for more information.
Value
ALL
string
This is a special identifier which can be used to listen for all events (mostly used for debugging purposes). The event will be a subclass of cast.framework.events.Event .
ABORT
string
Fired when the browser stops fetching the media before it is completely downloaded, but not due to an error. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
CAN_PLAY
string
Fired when the browser can resume playback of the clip, but estimates that not enough data has been loaded to play the clip to its end without having to stop for buffering. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
CAN_PLAY_THROUGH
string
Fired when the browser estimates that it can play the clip to its end without stopping for buffering. Note that the browser estimate only pertains to the current clip being played (ie: if currently playing an ad clip, the browser will estimate only for the ad clip and not the complete content). This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
DURATION_CHANGE
string
Fired when the duration attribute of the MediaElement has changed. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
EMPTIED
string
Fired when the media has become empty. One example where this would happen is when load() is called to reset the MediaElement. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
ENDED
string
Fired when a media clip has played to its full duration. This does not
include when the clip has stopped playing due to an error or stop request.
In the case that ads are present, this is fired at most once per ad, and at
most once for the main content. This event is forwarded from the
MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent
. If you want to know when the
media is done playing, you most likely want to use cast.framework.events.EventType.MEDIA_FINISHED
.
LOADED_DATA
string
Fired when the browser has finished loading the first frame of the media clip. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
LOADED_METADATA
string
Fired when the browser has finished loading the metadata for a clip. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
LOAD_START
string
Fired when the browser begins looking for media data for a clip. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
PAUSE
string
Fired when playback is paused. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaPauseEvent .
PLAY
string
Fired when playback is ready to start (ie: after being paused). This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
PLAYING
string
Fired when playback has started. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
PROGRESS
string
Fired when the browser is fetching media data. If you are using adaptive
bitrate streaming (ie: HLS, DASH, SMOOTH), you most likely want to use the cast.framework.events.EventType.SEGMENT_DOWNLOADED
event instead.
This event is forwarded from the MediaElement, and has been
wrapped in a cast.framework.events.MediaElementEvent
.
RATE_CHANGE
string
Fired when the playback rate has been updated. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
SEEKED
string
Fired when a seek has finished. This will not be fired in case seeking finishes when the media is paused. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
SEEKING
string
Fired when the media is being seeked. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
STALLED
string
Fired when the browser is trying to fetch media data, but did not receive
a response.
The cast.framework.events.EventType.BUFFERING
event is implemented
consistently across stream types, and should be used instead of 'stalled'
when trying to check if the player is buffering.
This event is forwarded from the MediaElement, and has been
wrapped in a cast.framework.events.MediaElementEvent
.
TIME_UPDATE
string
Fired periodically while the media is playing. This will fire whenever the currentTime attribute changes. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
SUSPEND
string
Fired when the browser is intentionally not fetching media data. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
WAITING
string
Fired when playback has stopped because the browser is waiting for the
next frame to become available. The cast.framework.events.EventType.BUFFERING
event is implemented
consistently across stream types, and should be used instead of 'waiting'
when trying to check if the player is buffering.
This event is forwarded from the MediaElement, and has been
wrapped in a cast.framework.events.MediaElementEvent
.
BITRATE_CHANGED
string
Fired when the bitrate of the playing media changes (such as when an active track is changed, or when a different bitrate is chosen in response to network conditions). Event is a cast.framework.events.BitrateChangedEvent .
BREAK_STARTED
string
Fired when the first break clip in a break is start loading. Event is a cast.framework.events.BreaksEvent .
BREAK_ENDED
string
Fired when the last break clip in a break ends. Event is a cast.framework.events.BreaksEvent .
BREAK_CLIP_LOADING
string
Fired when a break clip starts loading. Event is a cast.framework.events.BreaksEvent .
BREAK_CLIP_STARTED
string
Fired when a break clip starts. Event is a cast.framework.events.BreaksEvent .
BREAK_CLIP_ENDED
string
Fired when a break clip ends. Event is a cast.framework.events.BreaksEvent .
BUFFERING
string
Fired when playback has either stopped due to buffering, or started again after buffering has finished. Event is a cast.framework.events.BufferingEvent .
TIME_DRIFTED
string
Fired when there is a mismatch between the current time reported by the player and the estimated current time based on player state and playback rate. Event is a cast.framework.events.TimeDriftedEvent .
CACHE_LOADED
string
Fired when content pre-cached by fastplay has finished loading. Event is a cast.framework.events.CacheLoadedEvent .
CACHE_HIT
string
Fired when content pre-cached by fastplay is used. Event is a cast.framework.events.CacheItemEvent .
CACHE_INSERTED
string
Fired when one single URL is being cached by fastplay. Event is a cast.framework.events.CacheItemEvent .
CLIP_STARTED
string
Fired when any clip first starts to play. This includes break clips and main content clips between break clips. If you want to see when a break clip starts, you should use Event is a {@link cast.framework.events.Event.
CLIP_ENDED
string
Fired when any clip ends. This includes break clips and main content clips
between break clips. If you want to see when a break clip ends, you should
use cast.framework.events.EventType.BREAK_CLIP_ENDED
. If you want
to see when the media is completely done playing, you should use Event is a cast.framework.events.ClipEndedEvent.
EMSG
string
Fired when an emsg is found in a segment. Event is a cast.framework.events.EmsgEvent .
ERROR
string
Fired when an error occurs. Event is an cast.framework.events.ErrorEvent .
ID3
string
Fired when an ID3 tag is encountered. This will only be fired for HLS content. Event is a cast.framework.events.Id3Event .
MEDIA_STATUS
string
Fired before an outgoing message is sent containing current media status. Event is a cast.framework.events.MediaStatusEvent .
CUSTOM_STATE
string
Fired when an outgoing custom state message is sent. Event is a cast.framework.events.CustomStateEvent .
MEDIA_INFORMATION_CHANGED
string
Fired if the media information is changed during playback. For example when playing a live radio and the track metadata changed. Event is a cast.framework.events.MediaInformationChangedEvent
MEDIA_FINISHED
string
Fired when the media has completely finished playing. This includes the following cases: there is nothing left in the stream to play, user has requested a stop, or an error has occurred. When queueing is used, this event will trigger once for each queue item that finishes. Event is a cast.framework.events.MediaFinishedEvent .
PLAYER_PRELOADING
string
Fired when the player begins to handle a preload request. Event is a cast.framework.events.LoadEvent .
PLAYER_PRELOADING_CANCELLED
string
Fired if the player cancels preloading. Event is a cast.framework.events.LoadEvent .
PLAYER_LOAD_COMPLETE
string
Fired when the player has finished processing a load request and is ready to play. Event is a cast.framework.events.LoadEvent .
PLAYER_LOADING
string
Fired when the player begins to handle a load request. This would fire
before the cast.framework.events.EventType.LOAD_START
event, since
the player has not requested media data yet. Event is a cast.framework.events.LoadEvent
.
SEGMENT_DOWNLOADED
string
Fired when a segment is finished downloading. This will only be triggered for adaptive streaming content (HLS, DASH, or Smooth). Event is a cast.framework.events.SegmentDownloadedEvent .
REQUEST_GET_STATUS
string
Fired when a GET_STATUS
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_SEEK
string
Fired when a SEEK
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_LOAD
string
Fired when a LOAD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PRELOAD
string
Fired when a PRELOAD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_STOP
string
Fired when a STOP
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PAUSE
string
Fired when a PAUSE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PRECACHE
string
Fired when a PRECACHE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PLAY
string
Fired when a PLAY
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_SKIP_AD
string
Fired when a SKIP_AD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PLAY_AGAIN
string
Fired when a PLAY_AGAIN
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PLAYBACK_RATE_CHANGE
string
Fired when a SET_PLAYBACK_RATE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_VOLUME_CHANGE
string
Fired when a SET_VOLUME
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_EDIT_TRACKS_INFO
string
Fired when an EDIT_TRACKS_INFO message is received. Event is a cast.framework.events.RequestEvent .
REQUEST_EDIT_AUDIO_TRACKS
string
Fired when an EDIT_AUDIO_TRACKS message is received. Event is a cast.framework.events.RequestEvent .
REQUEST_SET_CREDENTIALS
string
Fired when a SET_CREDENTIALS
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_LOAD_BY_ENTITY
string
Fired when a LOAD_BY_ENTITY
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_USER_ACTION
string
Fired when a USER_ACTION
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_DISPLAY_STATUS
string
Fired when a DISPLAY_STATUS
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_CUSTOM_COMMAND
string
Fired when a CUSTOM_COMMAND
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_FOCUS_STATE
string
Fired when a FOCUS_STATE
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_QUEUE_LOAD
string
Fired when a QUEUE_LOAD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_INSERT
string
Fired when a QUEUE_INSERT
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_UPDATE
string
Fired when a QUEUE_UPDATE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_REMOVE
string
Fired when a QUEUE_REMOVE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_REORDER
string
Fired when a QUEUE_REORDER
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_GET_ITEM_RANGE
string
Fired when a QUEUE_GET_ITEM_RANGE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_GET_ITEMS
string
Fired when a QUEUE_GET_ITEMS
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_GET_ITEM_IDS
string
Fired when a QUEUE_GET_ITEM_IDS
message is received. Event is a cast.framework.events.RequestEvent
.
TRACKS_CHANGED
string
Fired if the available tracks changed after load complete.
LIVE_IS_MOVING_WINDOW_CHANGED
string
Fired when live seekable range isMovingWindow changed, more specifically, when a moving window changes to a expanding window or vice versa. Event is a cast.framework.events.LiveStatusEvent .
LIVE_ENDED
string
Fired when live is just ended. Event is a cast.framework.events.LiveStatusEvent .
TIMED_METADATA_CHANGED
string
When timed metadata is found in DASH (EventStream) or HLS (EXT-X-DATERANGE), this event is fired after PLAYER_LOAD_COMPLETE when new timed metadata is encountered in live content. Event is a cast.framework.events.TimedMetadataEvent .
TIMED_METADATA_ENTER
string
Fired when the playhead enters a timeline region in DASH or reaches an EXT-X-DATERANGE tag. Event is a cast.framework.events.TimedMetadataEvent .
TIMED_METADATA_EXIT
string
Fired when the playhead exits a timeline region in DASH or leaves an EXT-X-DATERANGE tag. Event is a cast.framework.events.TimedMetadataEvent .
Properties
DetailedErrorCode
number
Detailed Error code
Value
MEDIA_UNKNOWN
number
Returned when the HTMLMediaElement throws an error, but CAF does not recognize the specific error.
MEDIA_ABORTED
number
Returned when the fetching process for the media resource was aborted by the user agent at the user's request.
MEDIA_DECODE
number
Returned when an error occurred while decoding the media resource, after the resource was established to be usable.
MEDIA_NETWORK
number
Returned when a network error caused the user agent to stop fetching the media resource, after the resource was established to be usable.
MEDIA_SRC_NOT_SUPPORTED
number
Returned when the media resource indicated by the src attribute was not suitable.
SOURCE_BUFFER_FAILURE
number
Returned when a source buffer cannot be added to the MediaSource.
MEDIAKEYS_UNKNOWN
number
Returned when there is an unknown error with media keys.
MEDIAKEYS_NETWORK
number
Returned when there is a media keys failure due to a network issue.
MEDIAKEYS_UNSUPPORTED
number
Returned when a MediaKeySession object cannot be created.
MEDIAKEYS_WEBCRYPTO
number
Returned when crypto failed.
NETWORK_UNKNOWN
number
Returned when there was an unknown network issue.
SEGMENT_NETWORK
number
Returned when a segment fails to download.
HLS_NETWORK_MASTER_PLAYLIST
number
Returned when an HLS master playlist fails to download.
HLS_NETWORK_PLAYLIST
number
Returned when an HLS playlist fails to download.
HLS_NETWORK_NO_KEY_RESPONSE
number
Returned when an HLS key fails to download.
HLS_NETWORK_KEY_LOAD
number
Returned when a request for an HLS key fails before it is sent.
HLS_NETWORK_INVALID_SEGMENT
number
Returned when an HLS segment is invalid.
HLS_SEGMENT_PARSING
number
Returned when an HLS segment fails to parse.
DASH_NETWORK
number
Returned when an unknown network error occurs while handling a DASH stream.
DASH_NO_INIT
number
Returned when a DASH stream is missing an init.
SMOOTH_NETWORK
number
Returned when an unknown network error occurs while handling a Smooth stream.
SMOOTH_NO_MEDIA_DATA
number
Returned when a Smooth stream is missing media data.
MANIFEST_UNKNOWN
number
Returned when an unknown error occurs while parsing a manifest.
HLS_MANIFEST_MASTER
number
Returned when an error occurs while parsing an HLS master manifest.
HLS_MANIFEST_PLAYLIST
number
Returned when an error occurs while parsing an HLS playlist.
DASH_MANIFEST_UNKNOWN
number
Returned when an unknown error occurs while parsing a DASH manifest.
DASH_MANIFEST_NO_PERIODS
number
Returned when a DASH manifest is missing periods.
DASH_MANIFEST_NO_MIMETYPE
number
Returned when a DASH manifest is missing a MimeType.
DASH_INVALID_SEGMENT_INFO
number
Returned when a DASH manifest contains invalid segment info.
SMOOTH_MANIFEST
number
Returned when an error occurs while parsing a Smooth manifest.
SEGMENT_UNKNOWN
number
Returned when an unknown segment error occurs.
TEXT_UNKNOWN
number
An unknown error occurred with a text stream.
APP
number
Returned when an error occurs outside of the framework (e.g., if an event handler throws an error).
BREAK_CLIP_LOADING_ERROR
number
Returned when break clip load interceptor fails.
BREAK_SEEK_INTERCEPTOR_ERROR
number
Returned when break seek interceptor fails.
IMAGE_ERROR
number
Returned when an image fails to load.
LOAD_INTERRUPTED
number
A load was interrupted by an unload, or by another load.
LOAD_FAILED
number
A load command failed.
MEDIA_ERROR_MESSAGE
number
An error message was sent to the sender.
GENERIC
number
Returned when an unknown error occurs.
EndedReason
string
Reasons for how playback ends.
Value
END_OF_STREAM
string
Playback ended because we reach the end of current stream.
ERROR
string
Playback ended because we encountered an error.
STOPPED
string
Playback ended because an operation forces us to stop the current stream.
INTERRUPTED
string
Playback ended because of a new loaded item.
SKIPPED
string
Playback ended because of a skip ad operation.
BREAK_SWITCH
string
Playback ended because of switching stitched break.
ErrorSeverity
number
The error severity. Follows the same naming scheme and numbering as Shaka Player.
Value
RECOVERABLE
number
An error occurred, but the Player is attempting to recover from the error. If the Player cannot ultimately recover, it still may not throw a CRITICAL error. For example, retrying for a media segment will never result in a CRITICAL error (the Player will just retry forever).
CRITICAL
number
A critical error that the player cannot recover from. These cause player to stop the playback for the current media item.
EventType
string
Player event types. For events that are proxied from the MediaElement, see https://dev.w3.org/html5/spec-preview/media-elements.html#mediaevents for more information.
Value
ALL
string
This is a special identifier which can be used to listen for all events (mostly used for debugging purposes). The event will be a subclass of cast.framework.events.Event .
ABORT
string
Fired when the browser stops fetching the media before it is completely downloaded, but not due to an error. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
CAN_PLAY
string
Fired when the browser can resume playback of the clip, but estimates that not enough data has been loaded to play the clip to its end without having to stop for buffering. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
CAN_PLAY_THROUGH
string
Fired when the browser estimates that it can play the clip to its end without stopping for buffering. Note that the browser estimate only pertains to the current clip being played (ie: if currently playing an ad clip, the browser will estimate only for the ad clip and not the complete content). This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
DURATION_CHANGE
string
Fired when the duration attribute of the MediaElement has changed. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
EMPTIED
string
Fired when the media has become empty. One example where this would happen is when load() is called to reset the MediaElement. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
ENDED
string
Fired when a media clip has played to its full duration. This does not
include when the clip has stopped playing due to an error or stop request.
In the case that ads are present, this is fired at most once per ad, and at
most once for the main content. This event is forwarded from the
MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent
. If you want to know when the
media is done playing, you most likely want to use cast.framework.events.EventType.MEDIA_FINISHED
.
LOADED_DATA
string
Fired when the browser has finished loading the first frame of the media clip. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
LOADED_METADATA
string
Fired when the browser has finished loading the metadata for a clip. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
LOAD_START
string
Fired when the browser begins looking for media data for a clip. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
PAUSE
string
Fired when playback is paused. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaPauseEvent .
PLAY
string
Fired when playback is ready to start (ie: after being paused). This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
PLAYING
string
Fired when playback has started. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
PROGRESS
string
Fired when the browser is fetching media data. If you are using adaptive
bitrate streaming (ie: HLS, DASH, SMOOTH), you most likely want to use the cast.framework.events.EventType.SEGMENT_DOWNLOADED
event instead.
This event is forwarded from the MediaElement, and has been
wrapped in a cast.framework.events.MediaElementEvent
.
RATE_CHANGE
string
Fired when the playback rate has been updated. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
SEEKED
string
Fired when a seek has finished. This will not be fired in case seeking finishes when the media is paused. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
SEEKING
string
Fired when the media is being seeked. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
STALLED
string
Fired when the browser is trying to fetch media data, but did not receive
a response.
The cast.framework.events.EventType.BUFFERING
event is implemented
consistently across stream types, and should be used instead of 'stalled'
when trying to check if the player is buffering.
This event is forwarded from the MediaElement, and has been
wrapped in a cast.framework.events.MediaElementEvent
.
TIME_UPDATE
string
Fired periodically while the media is playing. This will fire whenever the currentTime attribute changes. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
SUSPEND
string
Fired when the browser is intentionally not fetching media data. This event is forwarded from the MediaElement, and has been wrapped in a cast.framework.events.MediaElementEvent .
WAITING
string
Fired when playback has stopped because the browser is waiting for the
next frame to become available. The cast.framework.events.EventType.BUFFERING
event is implemented
consistently across stream types, and should be used instead of 'waiting'
when trying to check if the player is buffering.
This event is forwarded from the MediaElement, and has been
wrapped in a cast.framework.events.MediaElementEvent
.
BITRATE_CHANGED
string
Fired when the bitrate of the playing media changes (such as when an active track is changed, or when a different bitrate is chosen in response to network conditions). Event is a cast.framework.events.BitrateChangedEvent .
BREAK_STARTED
string
Fired when the first break clip in a break is start loading. Event is a cast.framework.events.BreaksEvent .
BREAK_ENDED
string
Fired when the last break clip in a break ends. Event is a cast.framework.events.BreaksEvent .
BREAK_CLIP_LOADING
string
Fired when a break clip starts loading. Event is a cast.framework.events.BreaksEvent .
BREAK_CLIP_STARTED
string
Fired when a break clip starts. Event is a cast.framework.events.BreaksEvent .
BREAK_CLIP_ENDED
string
Fired when a break clip ends. Event is a cast.framework.events.BreaksEvent .
BUFFERING
string
Fired when playback has either stopped due to buffering, or started again after buffering has finished. Event is a cast.framework.events.BufferingEvent .
TIME_DRIFTED
string
Fired when there is a mismatch between the current time reported by the player and the estimated current time based on player state and playback rate. Event is a cast.framework.events.TimeDriftedEvent .
CACHE_LOADED
string
Fired when content pre-cached by fastplay has finished loading. Event is a cast.framework.events.CacheLoadedEvent .
CACHE_HIT
string
Fired when content pre-cached by fastplay is used. Event is a cast.framework.events.CacheItemEvent .
CACHE_INSERTED
string
Fired when one single URL is being cached by fastplay. Event is a cast.framework.events.CacheItemEvent .
CLIP_STARTED
string
Fired when any clip first starts to play. This includes break clips and main content clips between break clips. If you want to see when a break clip starts, you should use Event is a {@link cast.framework.events.Event.
CLIP_ENDED
string
Fired when any clip ends. This includes break clips and main content clips
between break clips. If you want to see when a break clip ends, you should
use cast.framework.events.EventType.BREAK_CLIP_ENDED
. If you want
to see when the media is completely done playing, you should use Event is a cast.framework.events.ClipEndedEvent.
EMSG
string
Fired when an emsg is found in a segment. Event is a cast.framework.events.EmsgEvent .
ERROR
string
Fired when an error occurs. Event is an cast.framework.events.ErrorEvent .
ID3
string
Fired when an ID3 tag is encountered. This will only be fired for HLS content. Event is a cast.framework.events.Id3Event .
MEDIA_STATUS
string
Fired before an outgoing message is sent containing current media status. Event is a cast.framework.events.MediaStatusEvent .
CUSTOM_STATE
string
Fired when an outgoing custom state message is sent. Event is a cast.framework.events.CustomStateEvent .
MEDIA_INFORMATION_CHANGED
string
Fired if the media information is changed during playback. For example when playing a live radio and the track metadata changed. Event is a cast.framework.events.MediaInformationChangedEvent
MEDIA_FINISHED
string
Fired when the media has completely finished playing. This includes the following cases: there is nothing left in the stream to play, user has requested a stop, or an error has occurred. When queueing is used, this event will trigger once for each queue item that finishes. Event is a cast.framework.events.MediaFinishedEvent .
PLAYER_PRELOADING
string
Fired when the player begins to handle a preload request. Event is a cast.framework.events.LoadEvent .
PLAYER_PRELOADING_CANCELLED
string
Fired if the player cancels preloading. Event is a cast.framework.events.LoadEvent .
PLAYER_LOAD_COMPLETE
string
Fired when the player has finished processing a load request and is ready to play. Event is a cast.framework.events.LoadEvent .
PLAYER_LOADING
string
Fired when the player begins to handle a load request. This would fire
before the cast.framework.events.EventType.LOAD_START
event, since
the player has not requested media data yet. Event is a cast.framework.events.LoadEvent
.
SEGMENT_DOWNLOADED
string
Fired when a segment is finished downloading. This will only be triggered for adaptive streaming content (HLS, DASH, or Smooth). Event is a cast.framework.events.SegmentDownloadedEvent .
REQUEST_GET_STATUS
string
Fired when a GET_STATUS
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_SEEK
string
Fired when a SEEK
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_LOAD
string
Fired when a LOAD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PRELOAD
string
Fired when a PRELOAD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_STOP
string
Fired when a STOP
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PAUSE
string
Fired when a PAUSE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PRECACHE
string
Fired when a PRECACHE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PLAY
string
Fired when a PLAY
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_SKIP_AD
string
Fired when a SKIP_AD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PLAY_AGAIN
string
Fired when a PLAY_AGAIN
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_PLAYBACK_RATE_CHANGE
string
Fired when a SET_PLAYBACK_RATE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_VOLUME_CHANGE
string
Fired when a SET_VOLUME
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_EDIT_TRACKS_INFO
string
Fired when an EDIT_TRACKS_INFO message is received. Event is a cast.framework.events.RequestEvent .
REQUEST_EDIT_AUDIO_TRACKS
string
Fired when an EDIT_AUDIO_TRACKS message is received. Event is a cast.framework.events.RequestEvent .
REQUEST_SET_CREDENTIALS
string
Fired when a SET_CREDENTIALS
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_LOAD_BY_ENTITY
string
Fired when a LOAD_BY_ENTITY
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_USER_ACTION
string
Fired when a USER_ACTION
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_DISPLAY_STATUS
string
Fired when a DISPLAY_STATUS
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_CUSTOM_COMMAND
string
Fired when a CUSTOM_COMMAND
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_FOCUS_STATE
string
Fired when a FOCUS_STATE
message is received. Event is a cast.framework.events.request.RequestEvent.
REQUEST_QUEUE_LOAD
string
Fired when a QUEUE_LOAD
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_INSERT
string
Fired when a QUEUE_INSERT
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_UPDATE
string
Fired when a QUEUE_UPDATE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_REMOVE
string
Fired when a QUEUE_REMOVE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_REORDER
string
Fired when a QUEUE_REORDER
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_GET_ITEM_RANGE
string
Fired when a QUEUE_GET_ITEM_RANGE
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_GET_ITEMS
string
Fired when a QUEUE_GET_ITEMS
message is received. Event is a cast.framework.events.RequestEvent
.
REQUEST_QUEUE_GET_ITEM_IDS
string
Fired when a QUEUE_GET_ITEM_IDS
message is received. Event is a cast.framework.events.RequestEvent
.
TRACKS_CHANGED
string
Fired if the available tracks changed after load complete.
LIVE_IS_MOVING_WINDOW_CHANGED
string
Fired when live seekable range isMovingWindow changed, more specifically, when a moving window changes to a expanding window or vice versa. Event is a cast.framework.events.LiveStatusEvent .
LIVE_ENDED
string
Fired when live is just ended. Event is a cast.framework.events.LiveStatusEvent .
TIMED_METADATA_CHANGED
string
When timed metadata is found in DASH (EventStream) or HLS (EXT-X-DATERANGE), this event is fired after PLAYER_LOAD_COMPLETE when new timed metadata is encountered in live content. Event is a cast.framework.events.TimedMetadataEvent .
TIMED_METADATA_ENTER
string
Fired when the playhead enters a timeline region in DASH or reaches an EXT-X-DATERANGE tag. Event is a cast.framework.events.TimedMetadataEvent .
TIMED_METADATA_EXIT
string
Fired when the playhead exits a timeline region in DASH or leaves an EXT-X-DATERANGE tag. Event is a cast.framework.events.TimedMetadataEvent .