Dữ liệu sự kiện của tất cả các sự kiện liên quan đến điểm chèn:
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 và
cast.framework.events.EventType.BREAK_CLIP_STARTED
Hàm dựng
BreaksEvent
mới
BreaksEvent(loại, currentMediaTime, chỉ mục, tổng, khi có thể bỏ qua, kết thúc lý do, breakClipId, breakId)
Mã của đoạn ngắt. Tham khảo Cast.framework.messages.BreakClip.id
breakId
Không bắt buộc
string
Mã điểm chèn quảng cáo. Tham khảo Cast.framework.messages.Break.id
Thuộc tính
breakClipId
hằng số
(chuỗi hoặc không xác định)
Mã của đoạn ngắt. Tham khảo Cast.framework.messages.BreakClip.id
breakId
hằng số
(chuỗi hoặc không xác định)
Mã điểm chèn quảng cáo. Tham khảo Cast.framework.messages.Break.id
currentMediaTime
hằng số
(số hoặc không xác định)
Thời gian trong nội dung nghe nhìn đang phát khi sự kiện ngắt xảy ra.
Đối với quảng cáo ghép phía máy khách, giá trị này thể hiện thời gian phát nội dung đa phương tiện của một đoạn ngắt khi sự kiện xảy ra.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ecast.framework.events.BreaksEvent\u003c/code\u003e class provides data for events related to breaks in media playback, such as break start, end, clip loading, and clip start/end.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003ebreakClipId\u003c/code\u003e, \u003ccode\u003ebreakId\u003c/code\u003e, \u003ccode\u003ecurrentMediaTime\u003c/code\u003e, \u003ccode\u003eendedReason\u003c/code\u003e, \u003ccode\u003eindex\u003c/code\u003e, \u003ccode\u003etotal\u003c/code\u003e, and \u003ccode\u003ewhenSkippable\u003c/code\u003e to provide detailed information about the break event.\u003c/p\u003e\n"],["\u003cp\u003eThe constructor for \u003ccode\u003eBreaksEvent\u003c/code\u003e takes parameters such as \u003ccode\u003etype\u003c/code\u003e, \u003ccode\u003ecurrentMediaTime\u003c/code\u003e, \u003ccode\u003eindex\u003c/code\u003e, \u003ccode\u003etotal\u003c/code\u003e, \u003ccode\u003ewhenSkippable\u003c/code\u003e, \u003ccode\u003eendedReason\u003c/code\u003e, \u003ccode\u003ebreakClipId\u003c/code\u003e, and \u003ccode\u003ebreakId\u003c/code\u003e to initialize the event data.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the \u003ccode\u003eBreaksEvent\u003c/code\u003e 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.\u003c/p\u003e\n"]]],[],null,["# Class: BreaksEvent\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[events](/cast/docs/reference/web_receiver/cast.framework.events).BreaksEvent\n================================================================================================================================================\n\nclass static\n\nEvent data for all events pertaining to breaks:\n`cast.framework.events.EventType.BREAK_ENDED`,\n`cast.framework.events.EventType.BREAK_STARTED`,\n`cast.framework.events.EventType.BREAK_CLIP_ENDED`,\n`cast.framework.events.EventType.BREAK_CLIP_LOADING`, and\n`cast.framework.events.EventType.BREAK_CLIP_STARTED`\n\nConstructor\n-----------\n\n### BreaksEvent\n\nnew\nBreaksEvent(type, currentMediaTime, index, total, whenSkippable, endedReason, breakClipId, breakId)\n\n| #### Parameter ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| type | [cast.framework.events.EventType](/cast/docs/reference/web_receiver/cast.framework.events#.EventType) Value must not be null. |\n| currentMediaTime | Optional number |\n| index | Optional number Index of current break clip among all break clips that break includes. |\n| total | Optional number Total number of break clip that break includes. |\n| whenSkippable | Optional number When current break get skippable. |\n| endedReason | Optional [cast.framework.events.EndedReason](/cast/docs/reference/web_receiver/cast.framework.events#.EndedReason) The reason the break clip ended. Value must not be null. |\n| breakClipId | Optional string The break clip's id. Refer to cast.framework.messages.BreakClip.id |\n| breakId | Optional string The break's id. Refer to cast.framework.messages.Break.id |\n\nProperties\n----------\n\n### breakClipId\n\nconstant\n\n(string or undefined)\n\nThe break clip's ID. Refer to cast.framework.messages.BreakClip.id\n\n### breakId\n\nconstant\n\n(string or undefined)\n\nThe break's id. Refer to cast.framework.messages.Break.id\n\n### currentMediaTime\n\nconstant\n\n(number or undefined)\n\nThe time in the currently-playing media when the break event occurred.\nFor the client-side stitched ads, this represents the media time of a\nbreak clip when the event occurred.\n\n### endedReason\n\nconstant\n\n(non-null [cast.framework.events.EndedReason](/cast/docs/reference/web_receiver/cast.framework.events#.EndedReason) or undefined)\n\nThe reason the break clip ended.\n\n### index\n\nconstant\n\n(number or undefined)\n\nIndex of break clip, which starts from 1.\n\n### total\n\nconstant\n\n(number or undefined)\n\nTotal number of break clips.\n\n### whenSkippable\n\nconstant\n\n(number or undefined)\n\nHow long the current break clip must play before the viewer is permitted\nto skip (in seconds)."]]