AI-generated Key Takeaways
-
The
cast.framework.events.BreaksEvent
class provides data for events related to breaks in media playback, such as break start, end, clip loading, and clip start/end. -
It includes properties like
breakClipId
,breakId
,currentMediaTime
,endedReason
,index
,total
, andwhenSkippable
to provide detailed information about the break event. -
The constructor for
BreaksEvent
takes parameters such astype
,currentMediaTime
,index
,total
,whenSkippable
,endedReason
,breakClipId
, andbreakId
to initialize the event data. -
Developers can use the
BreaksEvent
properties to access information about the break event, such as the break clip ID, break ID, current media time, and reason for the break clip ending.
cast.framework.events. 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
Constructor
BreaksEvent
new BreaksEvent(type, currentMediaTime, index, total, whenSkippable, endedReason, breakClipId, breakId)
Parameter |
|
---|---|
type |
cast.framework.events.EventType Value must not be null. |
currentMediaTime |
Optional number |
index |
Optional number Index of current break clip among all break clips that break includes. |
total |
Optional number Total number of break clip that break includes. |
whenSkippable |
Optional number When current break get skippable. |
endedReason |
Optional cast.framework.events.EndedReason The reason the break clip ended. Value must not be null. |
breakClipId |
Optional string The break clip's id. Refer to cast.framework.messages.BreakClip.id |
breakId |
Optional string The break's id. Refer to cast.framework.messages.Break.id |
Properties
breakClipId
(string or undefined)
The break clip's ID. Refer to cast.framework.messages.BreakClip.id
breakId
(string or undefined)
The break's id. Refer to cast.framework.messages.Break.id
currentMediaTime
(number or undefined)
The time in the currently-playing media when the break event occurred. For the client-side stitched ads, this represents the media time of a break clip when the event occurred.
endedReason
(non-null cast.framework.events.EndedReason or undefined)
The reason the break clip ended.
index
(number or undefined)
Index of break clip, which starts from 1.
total
(number or undefined)
Total number of break clips.
whenSkippable
(number or undefined)
How long the current break clip must play before the viewer is permitted to skip (in seconds).