GamStreamManager
Manages a Google IMA DAI SDK pod-serving session on Android — the Kotlin mirror of the web GamStreamManager. Initializes an IMA StreamManager via a PodStreamRequest, exposes the resulting streamId for pod-manifest URL construction (delegated to the portable buildGamPodUrl), and forwards ad progress/quartile events.
Pod manifests are stitched/played by the SDK's ad player (we build the pod URL ourselves); IMA tracks ad progress from the stream's timed metadata, which the player forwards via processMetadata. Requires a device/emulator at runtime (the IMA SDK has no headless mode); this class is structured for that.
Functions
The IMA stream id of the initialized session, or null before isInitialized.
Initialize a fresh IMA pod-serving session and suspend until the stream id is available (or the request errors). Always resets any prior session.
Open a full-service IMA DAI live-stream session and suspend until IMA hands back the stitched stream URL to play on the content player.
Whether a stream session has been initialized with a valid streamId.
Forward timed metadata (HLS ID3 TXXX text) from the ad player to IMA.
Forward an in-stream timed-metadata marker (from the content player in SSAI mode) to IMA for ad tracking. Picks the ID3 TXXX user text (falling back to the first frame / message payload). No-op when no text is present.
Replace ad-tag parameters on the active stream session. No-op if not initialized.
Install the sink for IMA ad-progress events; replaces any earlier one.