IMA DAI#
Introduction#
The KWIKplayer IMA DAI Plugin integrates Dynamic Ad Insertion (DAI) with the KWIKplayer using Google's IMA SDK. This plugin enables seamless ad playback in live and Video on Demand (VOD) streams while providing options for stream configuration, localization, and ad behavior customization.
Configuration Options#
The plugin accepts the following configuration options:
Option | Type | Default | Description |
---|---|---|---|
isLiveStream | boolean | false | Indicates if the stream is a live stream. |
streamFormat | 'hls' | 'dash' | 'hls' | Format of the stream. Only 'hls' is supported. |
assetKey | string | null | Identifier for live stream assets. Required for live streams. |
cmsId | string | null | CMS ID for VOD streams. Required for VOD streams. |
videoId | string | null | Video ID for VOD streams. Required for VOD streams. |
adTagParameters | object | {} | Parameters for ad tag requests. |
apiKey | string | null | API key for stream access. |
authToken | string | null | Authorization token for requests. |
bookmarkTime | number | null | Start time of the content in seconds, for resuming playback. |
fallbackStreamUrl | string | null | Fallback stream URL in case of primary stream failure. |
locale | string | null | Locale for content localization (e.g., en-US ). |
streamActivityMonitorId | string | null | Monitoring ID for debugging and tracking stream activity. |
Events#
The plugin triggers specific events during its lifecycle:
Event | Description |
---|---|
stream-manager | Emitted when the stream manager is initialized. |
stream-request | Emitted when a stream request is initiated. |
Usage#
Initialization#
To initialize the plugin, configure the imaDaiPlugin
options in the KWIKplayer settings:
window.initPlayer('my-video', { imaDaiPlugin: { isLiveStream: true, streamFormat: 'hls', assetKey: 'your-live-asset-key', adTagParameters: { someParameter: 'value', }, locale: 'en-US', }, })