UNPKG

video-ad-sdk

Version:

VAST/VPAID SDK that allows video ads to be played on top of any player

51 lines (50 loc) 1.6 kB
import type { ExecutionContext } from '../types'; import { type LoadScriptOptions } from './helpers/loadScript'; declare const hidden: unique symbol; /** * Options map to add script to {@link VideoAdContainer} */ export type AddScriptOptions = Omit<LoadScriptOptions, 'placeholder'>; /** * This class provides everything necessary to contain and create a video ad within a given placeholder Element. */ export declare class VideoAdContainer { element: HTMLElement; slotElement?: HTMLElement; videoElement: HTMLVideoElement; executionContext?: ExecutionContext; isOriginalVideoElement: boolean; private [hidden]; /** * Creates a VideoAdContainer. * * @param placeholder DIV that will contain the ad. * @param videoElement optional videoElement that will be used to play the ad. */ constructor(placeholder: HTMLElement, videoElement?: HTMLVideoElement); /** * Adds the passed script to the ad container. * * @param src script source uri. * @param options Options map. */ addScript(source: string, options?: AddScriptOptions): Promise<HTMLScriptElement>; /** * Adds the slot to the ad container. * * @param width - Slot width. * @param height - Slot height. */ addSlot(width: number, height: number): void; /** * Destroys the VideoAdContainer. */ destroy(): Promise<void>; /** * Checks if the container is destroyed. * * @returns true if the container is destroyed and false otherwise. */ isDestroyed(): boolean; } export {};