OptiView Ads SDK for React Native
    Preparing search index...

    Class WebOptiViewAdsConnector

    The react-native-web OptiViewAdsConnector: the same public facade surface as the native connector, delegating every call to an in-process @dolby-optiview/ads-sdk OptiViewAds — no bridge, no TurboModule, no serialization.

    Parity notes:

    • Accessors and status/diagnostics calls resolve immediately (no bridge hop), but stay promise-returning so application code is portable.
    • InterceptorPolicy timeouts do not apply: interceptors run in-process, so the web SDK's own interceptor semantics (non-fatal, DA-MANIFEST-*INTERCEPT-FAILED diagnostics on throw) govern instead.
    • Event payloads are the web SDK's events verbatim (volumechange reflects the effective audio owner exactly as documented for web).

    Implements

    Index
    • Detach from the player and destroy the native SDK instance. Idempotent. Must be called before the hosting player view unmounts.

      Returns Promise<void>

    • End the current session. Mirrors web OptiViewAds.endSession.

      Returns Promise<void>

    • Replace the live-update layer of the asset parameters. Mirrors web OptiViewAds.updateAssetParameters.

      Per-key precedence: SessionConfig.assetParameters < updateAssetParameters() < the manifest session layer (vendorConfiguration.gam.sgai[0].assetParameters or ssai[0].assetParameters) < the per-asset assetParameters. It replaces the previous update rather than accumulating onto it. Applies to future ad breaks.

      Parameters

      • params: Record<string, string>

      Returns Promise<void>

    • Report an ad click and return its click-through URL without navigating.

      Returns Promise<string | null>

    • Whether ad playback is muted. Mirrors web OptiViewAds.muted.

      Returns Promise<boolean>

    • What the SDK is presenting right now: whether the content player is in picture-in-picture, and which media owns the surface. Mirrors the web OptiViewAds.getPresentationState() — both halves are the SDK's own decisions, so an application (or test harness) inferring them would be duplicating rules that change. The one every PiP integration needs: while pinned, a forced-single ad plays THROUGH the content player (insertion: 'shared-element'), so the player's own clock reports the AD's progress — anything displaying or asserting content position must consult showing/insertion instead of reading the player directly.

      Returns Promise<RnPresentationState>

    • Ad playback volume in [0, 1]. Mirrors web OptiViewAds.volume.

      Returns Promise<number>

    • Report the host app's picture-in-picture state so the SDK can adjust the break layout (a PiP window is one small surface, so multi-surface break formats are forced to single while pinned).

      Only needed for host players whose library has no presentation-mode event surface the bridge can observe — i.e. react-native-video, where the integrator wires it from the view's own event:

      <Video onPictureInPictureStatusChanged={(e) => connector.notePictureInPicture(e.isActive)} 
      

      react-native-theoplayer hosts must NOT call this: the bridge already observes the player's presentation-mode events there, and the call is ignored natively (one source of truth per instance). State-only — the SDK never opens or closes a PiP window itself.

      Returns Promise<void>

    • Seek content to time seconds. Mirrors web OptiViewAds.seek: the SDK owns the seek policy — suppressed during breaks with controls.snapback, no-op without a session. Prefer this over seeking the host player directly, which bypasses the policy.

      Parameters

      • time: number

      Returns Promise<void>

    • Mute or unmute ad playback; content follows the SDK's audio rules.

      Parameters

      • muted: boolean

      Returns Promise<void>

    • Set the ad playback volume in [0, 1]; values outside are clamped.

      Parameters

      • volume: number

      Returns Promise<void>

    • Skip the active ad break when its manifest policy allows it.

      Returns Promise<boolean>