StreamManager

public interface StreamManager implements BaseManager

An object which manages dynamic ad insertion streams. After the StreamManager is retrieved from an AdsManagerLoadedEvent, init should be called.

Public Method Summary

abstract double
getContentTimeForStreamTime(double streamTime)
Returns the content time without ads for a given stream time.
abstract List<CuePoint>
getCuePoints()
Returns the CuePoints for the current VOD stream, which are available after CUEPOINTS_CHANGED is broadcast.
abstract CuePoint
getPreviousCuePointForStreamTime(double streamTime)
Returns the previous cuepoint for the given VOD stream time.
abstract String
getStreamId()
Get the identifier used during server side ad insertion to uniquely identify a stream.
abstract double
getStreamTimeForContentTime(double contentTime)
Returns the stream time with ads for a given content time.
abstract void
replaceAdTagParameters(Map<String, String> adTagParameters)
Replaces all the ad tag parameters used for the upcoming ad requests for a live stream.

Inherited Method Summary

Public Methods

public abstract double getContentTimeForStreamTime (double streamTime)

Returns the content time without ads for a given stream time. Returns the given stream time for live streams.

Parameters
streamTime the stream time with inserted ads (in seconds)
Returns
  • the content time that corresponds with the given stream time once ads are removed

public abstract List<CuePoint> getCuePoints ()

Returns the CuePoints for the current VOD stream, which are available after CUEPOINTS_CHANGED is broadcast. Returns empty list for live streams.

public abstract CuePoint getPreviousCuePointForStreamTime (double streamTime)

Returns the previous cuepoint for the given VOD stream time. Returns null if there is no previous cue point, or if called for a live stream. This is used to implement features like snap back in order to return the user to a skipped ad break.

Parameters
streamTime the stream time (in seconds).
Returns
  • the previous CuePoint for the given stream time.

public abstract String getStreamId ()

Get the identifier used during server side ad insertion to uniquely identify a stream. Returns null if server side ad insertion was not used.

public abstract double getStreamTimeForContentTime (double contentTime)

Returns the stream time with ads for a given content time. Returns the given content time for live streams.

Parameters
contentTime the content time without any ads (in seconds)
Returns
  • the stream time that corresponds with the given content time once ads are inserted

public abstract void replaceAdTagParameters (Map<String, String> adTagParameters)

Replaces all the ad tag parameters used for the upcoming ad requests for a live stream. Note that this call is a no-op for VOD streams.

Parameters
adTagParameters the new ad tag parameters to use for the current stream.