AI-generated Key Takeaways
-
MediaFinishedEvent
provides data for thecast.framework.events.EventType.MEDIA_FINISHED
event, indicating the completion of media playback. -
It includes the
currentMediaTime
(in seconds) and theendedReason
(e.g., ended by user, reached end, error). -
Developers can access these properties to understand why and when the media finished playing within the Cast framework.
cast.framework.events. MediaFinishedEvent
Event data for a cast.framework.events.EventType.MEDIA_FINISHED
event.
Constructor
MediaFinishedEvent
new MediaFinishedEvent(currentMediaTime, endedReason)
Parameter |
|
---|---|
currentMediaTime |
Optional number |
endedReason |
Optional cast.framework.events.EndedReason Value must not be null. |
Properties
currentMediaTime
(number or undefined)
The time when the media finished (in seconds). For an item in a queue, this value represents the time in the currently-playing queue item ( where 0 means the queue item has just started).
endedReason
(non-null cast.framework.events.EndedReason or undefined)
The reason the media finished.