OptiView Ads SDK
    Preparing search index...

    Type Alias CreateAdAdapter

    CreateAdAdapter: (
        container: HTMLElement,
        video?: HTMLVideoElement,
    ) => PlayerAdapter

    Factory for a custom ad player: create media elements inside the supplied container and return a PlayerAdapter. When video is provided, use that existing content video element so ads remain visible in picture-in-picture or native fullscreen. If the factory ignores it, the SDK falls back to the content player.

    Type Declaration

      • (container: HTMLElement, video?: HTMLVideoElement): PlayerAdapter
      • Parameters

        • container: HTMLElement
        • Optionalvideo: HTMLVideoElement

        Returns PlayerAdapter

    createAdAdapter: (container, video) => {
    const el = video ?? container.appendChild(document.createElement('video'));
    const hls = new Hls(); hls.attachMedia(el);
    return new HlsJsAdapter(hls, el);
    }