ima
.
StreamManager
Constructor
StreamManager
new StreamManager()
Object for managing stream playback.
Methods
addEventListener
addEventListener(event, callback)
Adds a listener for the specified event. See the AdEvents constant for supported events.
Parameter
event
string
callback
function()
createStreamManager
createStreamManager(streamRequest, streamInitResponse) returns ima.StreamManager
Parameter
streamRequest
streamInitResponse
ima.StreamInitResponse
- Returns
enableInteractiveAds
enableInteractiveAds()
Unsupported. Instead pass data from the companion ad to RAF directly. This is now a no op.
getContentTime
getContentTime(streamTime) returns Integer
Gets a time in milliseconds for a VOD stream, representing the time in
the content without ads.
For more details, see the FAQ
.
To get the content time for the current stream time pass in -1
.
Parameter
streamTime
Integer
The time in the stream.
- Returns
-
IntegerThe content time corresponding to the given stream time.
getCuePoints
getCuePoints() returns Object
Returns all cue points corresponding to all ad breaks. This is only
valid for video on demand content where all ad breaks are known ahead
of time. All times represent the stream time in seconds.
For Cloud Stitching API streams, the hasPlayed
property of each ima.CuePoint
is always false.
- Returns
-
ObjectAn array with all cue points.
getPreviousCuePoint
getPreviousCuePoint(time) returns ima.CuePoint
Returns the cue point preceding this time. The cue point indicates an ad break. All times represent the stream time in seconds.
Parameter
time
Float
The time to look up, -1
indicates current time, and returns Invalid
for all other streams.
- Returns
-
ima.CuePointAn object with start, end, and hasPlayed. Returns Invalid if no cue point is available.
getStreamTime
getStreamTime(contentTime) returns Integer
Gets time for the stream from a content time for VOD in milliseconds. For more details, see the FAQ .
Parameter
contentTime
Integer
The time of the content.
- Returns
-
IntegerThe stream time corresponding to the given content time.
loadThirdPartyStream
loadThirdPartyStream(streamManifest, streamSubtitle)
Loads the ad metadata and calls the loadUrl
function with the
provided streamManifestUrl
and streamSubtitle
data. This function only works when the stream request type is ima.StreamType.POD_VOD
.
Parameter
streamManifest
string
The stream manifest URL with ads stitched.
streamSubtitle
(Array of Array of T or Invalid)
The subtitles
associate with the stream, or Invalid
if none.
onMessage
onMessage(msg)
Handles all messages coming from the Video object. Must be called for each message received on the roMessagePort.
Parameter
msg
object
The message from the roVideo port.
replaceAdTagParameters
replaceAdTagParameters(adTagParameters)
Replaces all of the ad tag parameters to be used for the upcoming ad requests for a live stream. Note that this call is a no-op for VOD streams.
Parameter
adTagParameters
string
The new ad tag parameters.
start
start()
Starts playback of the stream.

