Methods

getBreakById

getBreakById(id) returns cast.framework.messages.Break

Get current media break by id.

Parameter

id

string

Break id.

Returns

nullable cast.framework.messages.Break 

getBreakClipById

getBreakClipById(id) returns cast.framework.messages.BreakClip

Get current media break clip by id.

Parameter

id

string

Clip id.

Returns

nullable cast.framework.messages.BreakClip 

getBreakClips

getBreakClips() returns Array of non-null cast.framework.messages.BreakClip

Get current media break clips.

Returns

non-null Array of non-null cast.framework.messages.BreakClip 

getBreaks

getBreaks() returns Array of non-null cast.framework.messages.Break

Get current media breaks.

Returns

non-null Array of non-null cast.framework.messages.Break 

getPlayWatchedBreak

getPlayWatchedBreak() returns boolean

Returns true if watched breaks should be played.

Returns

boolean 

setBreakClipLoadInterceptor

setBreakClipLoadInterceptor(interceptor)

Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started.

If interceptor is null it will reset the interceptor to default one. By default VAST fetching and parsing logic in default interceptor. So if customized interceptor is set by developer, the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor.

Parameter

interceptor

function(non-null cast.framework.messages.BreakClip, optional non-null cast.framework.breaks.BreakClipLoadInterceptorContext)

The default break clip load interceptor will return the same break clip as input.

Value may be null.

setBreakSeekInterceptor

setBreakSeekInterceptor(seekInterceptor)

Provide an interceptor for developer to specify what breaks they want to play after seek.

Parameter

seekInterceptor

function(non-null 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.

setPlayWatchedBreak

setPlayWatchedBreak(playWatchedBreak)

Set a flag to control if the watched client stitching break should be played.

Parameter

playWatchedBreak

boolean

setVastTrackingInterceptor

setVastTrackingInterceptor(interceptor)

Provide an interceptor to modify VAST tracking URL before it is being sent to server. The input of the interceptor is a string of the tracking URL. The interceptor can either return a modified string of URL or a Promise of modified string of URL. The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF.

Parameter

interceptor

function(string)

An interceptor which modifies the URL before sent.

Value may be null.