Interceptor(개발자가 기본값으로 재설정하려는 경우) 또는 null입니다.
기본 중단 탐색 인터셉터는 navigationTo 값에서 가장 가까운 중단을 반환합니다.
값이 null일 수 있습니다.
setPlayWatchedBreak
setPlayWatchedBreak(playWatchedBreak)
감시된 클라이언트 병합 브레이크를 재생할지 여부를 제어하는 플래그를 설정합니다.
매개변수
playWatchedBreak
boolean
setVastTrackingInterceptor
setVastTrackingInterceptor(interceptor)
VAST 추적 URL이 서버로 전송되기 전에 수정할 수 있도록 인터셉터를 제공합니다.
인터셉터의 입력은 추적 URL의 문자열입니다.
인터셉터는 URL의 수정된 문자열 또는 수정된 URL 문자열의 프로미스를 반환할 수 있습니다.
CAF 대신 자체 코드로 추적 URL을 전송하려는 경우에도 인터셉터는 null을 반환할 수 있습니다.
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eBreakManager\u003c/code\u003e class provides methods for managing breaks (ads) within media content on a Cast receiver.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can add, remove, and retrieve information about breaks and break clips using the provided methods.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBreakManager\u003c/code\u003e allows customization of break behavior through interceptors for loading, seeking, and VAST tracking.\u003c/p\u003e\n"],["\u003cp\u003eIt offers functionality to control whether watched breaks should be played.\u003c/p\u003e\n"],["\u003cp\u003eMethods are available to access details about the currently playing break clip, including its duration and current time.\u003c/p\u003e\n"]]],[],null,["# Class: BreakManager\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[breaks](/cast/docs/reference/web_receiver/cast.framework.breaks).BreakManager\n=================================================================================================================================================\n\nclass static\n\nClass to manage breaks.\n\nMethods\n-------\n\n### addBreak\n\naddBreak(breakData, breakClips, broadCastMediaStatus) returns boolean\n\nAdds dynamic break and break clips.\nThe break clips will be associated with the break (break.breakClipIds and\nbreak.duration will be updated according to the clips).\n\n| #### Parameter ||\n|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| breakData | [cast.framework.messages.Break](/cast/docs/reference/web_receiver/cast.framework.messages.Break) Value must not be null. |\n| breakClips | Array of non-null [cast.framework.messages.BreakClip](/cast/docs/reference/web_receiver/cast.framework.messages.BreakClip) Value must not be null. |\n| broadCastMediaStatus | Optional boolean Whether CAF should check if the current break status has changed. This may not be desirable before playback begins, as the receiver may still need to add more breaks (e.g., during load complete). |\n\nReturns\n\n: `boolean` True if break was added successfully.\n\n### getBreakById\n\ngetBreakById(id) returns [cast.framework.messages.Break](/cast/docs/reference/web_receiver/cast.framework.messages.Break)\n\nGets current media break by id.\n\n| #### Parameter ||\n|----|------------------|\n| id | string Break id. |\n\nReturns\n\n: `nullable `[cast.framework.messages.Break](/cast/docs/reference/web_receiver/cast.framework.messages.Break)\n\n### getBreakClipById\n\ngetBreakClipById(id) returns [cast.framework.messages.BreakClip](/cast/docs/reference/web_receiver/cast.framework.messages.BreakClip)\n\nGets current media break clip by id.\n\n| #### Parameter ||\n|----|-----------------|\n| id | string Clip id. |\n\nReturns\n\n: `nullable `[cast.framework.messages.BreakClip](/cast/docs/reference/web_receiver/cast.framework.messages.BreakClip)\n\n### getBreakClipCurrentTimeSec\n\ngetBreakClipCurrentTimeSec() returns number\n\nReturns current time in sec in currently-playing break clip.\n\nReturns\n\n: `nullable number` Current time in sec inside current break clip. Null, if\n player is not playing break clip.\n\n### getBreakClipDurationSec\n\ngetBreakClipDurationSec() returns number\n\nReturns duration in sec of currently-playing break clip.\n\nReturns\n\n: `nullable number` Duration of current break clip. Null, if player is not\n playing break clip.\n\n### getBreakClips\n\ngetBreakClips() returns Array of non-null [cast.framework.messages.BreakClip](/cast/docs/reference/web_receiver/cast.framework.messages.BreakClip)\n\nGets current media break clips.\n\nReturns\n\n: `non-null Array of non-null `[cast.framework.messages.BreakClip](/cast/docs/reference/web_receiver/cast.framework.messages.BreakClip)\n\n### getBreaks\n\ngetBreaks() returns Array of non-null [cast.framework.messages.Break](/cast/docs/reference/web_receiver/cast.framework.messages.Break)\n\nGets current media breaks.\n\nReturns\n\n: `non-null Array of non-null `[cast.framework.messages.Break](/cast/docs/reference/web_receiver/cast.framework.messages.Break)\n\n### getCreativeInfoByClipId\n\ngetCreativeInfoByClipId(breakClipId) returns [cast.framework.breaks.CreativeInformation](/cast/docs/reference/web_receiver/cast.framework.breaks.CreativeInformation)\n\nGets creative information associated with breakclip by id.\n\n| #### Parameter ||\n|-------------|-----------------|\n| breakClipId | string Clip id. |\n\nReturns\n\n: `nullable `[cast.framework.breaks.CreativeInformation](/cast/docs/reference/web_receiver/cast.framework.breaks.CreativeInformation)\n\n### getPlayWatchedBreak\n\ngetPlayWatchedBreak() returns boolean\n\nReturns true if watched breaks should be played.\n\nReturns\n\n: `boolean`\n\n### removeBreakById\n\nremoveBreakById(breakId) returns boolean\n\nRemoves a break and associated break clips.\n\n| #### Parameter ||\n|---------|-----------------|\n| breakId | string Break Id |\n\nReturns\n\n: `boolean` True if break was removed successfully.\n\n### setBreakClipLoadInterceptor\n\nsetBreakClipLoadInterceptor(interceptor)\n\nProvides an interceptor to allow developer to insert more break clips\nor modify current break clip\nbefore a break is started.\n\nIf interceptor is null it will reset the interceptor to default one.\nBy default VAST fetching and parsing logic in default interceptor.\nSo if customized interceptor is set by developer, the VAST logic will be\noverridden and developers should implement their own VAST fetching and\nparsing logic in the provided interceptor.\n\n| #### Parameter ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| interceptor | function(non-null [cast.framework.messages.BreakClip](/cast/docs/reference/web_receiver/cast.framework.messages.BreakClip), optional non-null [cast.framework.breaks.BreakClipLoadInterceptorContext](/cast/docs/reference/web_receiver/cast.framework.breaks.BreakClipLoadInterceptorContext)) The default break clip load interceptor will return the same break clip as input. Value may be null. |\n\n### setBreakSeekInterceptor\n\nsetBreakSeekInterceptor(seekInterceptor)\n\nProvides an interceptor for developer to specify\nwhat breaks they want to play after seek.\n\n| #### Parameter ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| seekInterceptor | function(non-null [cast.framework.breaks.BreakSeekData](/cast/docs/reference/web_receiver/cast.framework.breaks.BreakSeekData)) Interceptor or null if developer wants to reset it to default one. The default break seek interceptor will return the closest break from the seekTo value. Value may be null. |\n\n### setPlayWatchedBreak\n\nsetPlayWatchedBreak(playWatchedBreak)\n\nSets a flag to control if the watched client stitching break\nshould be played.\n\n| #### Parameter ||\n|------------------|---------|\n| playWatchedBreak | boolean |\n\n### setVastTrackingInterceptor\n\nsetVastTrackingInterceptor(interceptor)\n\nProvides an interceptor to modify VAST tracking URL before it is being sent\nto server.\nThe input of the interceptor is a string of the tracking URL.\nThe interceptor can either return a modified string of URL\nor a Promise of modified string of URL.\nThe interceptor can also return null if you want to send the\ntracking URL by your own code instead of by CAF.\n\n| #### Parameter ||\n|-------------|----------------------------------------------------------------------------------------|\n| interceptor | function(string) An interceptor which modifies the URL before sent. Value may be null. |"]]