OverlayAdRenderer
Overlay AdRenderer for Android: plays break assets on a dedicated ad ExoPlayer in a PlayerView above the integrator's content surface. Event ORDER comes from the portable AdBreakSequencer; this class only performs side effects and reports outcomes back.
The responsibilities live in extension files of the same package (Overlay*.kt); this file holds the state, the public API and the break entry points. All ExoPlayer interaction is marshalled onto Dispatchers.Main.
Constructors
Functions
AdRenderer.abortBreak: ends the in-progress break now and resumes content at the break start plus resumeOffsetSec.
AdRenderer.destroy: restores content state, releases the ad player and removes the overlay views.
AdRenderer.endGamSession: resets the IMA stream manager and drops the session asset parameters.
AdRenderer.endSteeredSsaiSession: resets the IMA stream manager of a steered ssai session.
AdRenderer.forwardSsaiTimedMetadata: hands the content cue to the IMA stream manager.
AdRenderer.hidePauseAd: fades the pause ad out and releases its resources.
AdRenderer.initialize: builds the ad PlayerView, the image and companion views and the GAM stream manager inside overlayContainer.
AdRenderer.isAdPlaying: true from break begin to break end.
Not gated on a GamConfig being supplied, only on the explicit opt-out.
An lshape_content break in PiP is active but shows no ad; isAdPlaying stays true.
AdRenderer.playBreak: plays the selected variant of breakInfo asset by asset and suspends until the break ends or is cut.
AdRenderer.preload: warms the media of the variant that will play, subject to the preload mode.
AdRenderer.prepareAdRequest: awaits the installed preparer, if any.
AdRenderer.revealPauseAdResume: shows the resume control of the mounted pause ad.
AdRenderer.setAdClickHandler: installs the handler invoked when the viewer taps the ad surface.
AdRenderer.setAdPreloadMode: decides whether preload may warm media in the ad player.
AdRenderer.setAdRequestPreparer: installs the hook awaited before every ad request.
AdRenderer.setAudio: applies the unified mute and volume to the ad player and any pause-ad video.
AdRenderer.setBreakCutSafetyMargin: overrides the constructor adBreakCutSafetyMarginSec.
AdRenderer.setBreakResumePolicy: sets the insertion type, timebase and continue-content option that decide where content resumes.
AdRenderer.setChainResolver: installs the resolver used to soft-end into a chained break.
AdRenderer.setDiagnoseHandler: installs the sink for renderer diagnostics.
AdRenderer.setDoubleBoxAudio: selects which side stays audible in a double break.
AdRenderer.setGamEventCallbacks: installs the quartile sink for GAM and VAST ads.
AdRenderer.setManifestAssetParameters: installs the manifest session layer and pushes a change to a live IMA session.
AdRenderer.setPauseAdCreativeEndedCallback: installs the callback for a pause-ad video that ended or failed.
AdRenderer.setPictureInPicture: re-lays out a break in flight as single when picture-in-picture starts.
AdRenderer.setPictureInPictureChangeHandler: starts watching the host Activity for picture-in-picture changes; null stops watching.
AdRenderer.setSessionAssetParameterMacros: installs the customer macros for the session.
AdRenderer.setSessionAssetParameters: installs the session layer of the asset parameters.
AdRenderer.setTransitionDurationMs: overrides the constructor transitionMs; 0 cuts without a fade.
AdRenderer.setTransitionPhaseReporter: installs the break-transition checkpoint reporter used in debug mode.
AdRenderer.showPauseAd: resolves the pause-ad creative and fades it in over the paused content.
AdRenderer.startGamSession: opens the IMA pod-serving stream for identity and installs the session asset parameters.
Unlike startGamSession the ads arrive inside the stitched stream; no pod is played.
AdRenderer.updateAssetParameterMacros: merges the customer macros and pushes them to a live IMA session.
AdRenderer.updateAssetParameters: replaces the live-update layer and pushes the merged parameters to IMA.
PiP narrows the playable-format set to single + the suppressed lshape_content.