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:

OptionTypeDefaultDescription
isLiveStreambooleanfalseIndicates if the stream is a live stream.
streamFormat'hls' | 'dash''hls'Format of the stream. Only 'hls' is supported.
assetKeystringnullIdentifier for live stream assets. Required for live streams.
cmsIdstringnullCMS ID for VOD streams. Required for VOD streams.
videoIdstringnullVideo ID for VOD streams. Required for VOD streams.
adTagParametersobject{}Parameters for ad tag requests.
apiKeystringnullAPI key for stream access.
authTokenstringnullAuthorization token for requests.
bookmarkTimenumbernullStart time of the content in seconds, for resuming playback.
fallbackStreamUrlstringnullFallback stream URL in case of primary stream failure.
localestringnullLocale for content localization (e.g., en-US).
streamActivityMonitorIdstringnullMonitoring ID for debugging and tracking stream activity.

Events#

The plugin triggers specific events during its lifecycle:

EventDescription
stream-managerEmitted when the stream manager is initialized.
stream-requestEmitted 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',
  },
})