StreamManager
Handles dynamic ad insertion streams. It manages interactions with the DAI backend and handles tracking pings as well as forwarding stream and ad events to the publisher. Integrates with the CAF API for ad UI.
Constructor
StreamManager
new StreamManager(mediaElement)
Parameter |
|
---|---|
mediaElement |
Optional The HTML media element where playback will occur. Only provide if using a custom player. Value may be null. |
- Throws
-
when required parameters are not supplied.
- @implements {EventTarget}
Methods
getStreamId
getStreamId() returns string
Returns the stream id for the current stream.
- Returns
-
nullable string
loadStreamMetadata
loadStreamMetadata()
Requests SDK to load ad metadata and then broadcasts StreamEvent.LOADED. This should be manually trigger once the stream manifest has been retrieved from 3rd party video stitcher. This is only used for Pod Serving VOD with 3rd party video stitcher, and is no-op for other stream request.
replaceAdTagParameters
replaceAdTagParameters(adTagParameters)
Replaces all of the ad tag parameters used for upcoming ad requests for a live stream.
Parameter |
|
---|---|
adTagParameters |
Object with string properties The new ad tag parameters. Must have string values. Value must not be null. |
requestStream
requestStream(loadRequest, streamRequest) returns Promise containing nullable CafLoadInterceptorReturnType
Requests a stream to be loaded using provided stream parameters. Populates the loadRequest with the loaded stream data.
Parameter |
|
---|---|
loadRequest |
cast.framework.messages.LoadRequestData Value must not be null. |
streamRequest |
Value must not be null. |
- Returns
-
non-null Promise containing nullable CafLoadInterceptorReturnType
reset
reset()
Resets the stream manager and removes any continuous polling.