Server-Side Ad Insertion

This plugin allows you to play Server-Side Ad Insertion streams.

Installation

Include the plugin script next to the core player:

Copy
Copied
<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/ssai.min.js"></script>

Configuration

The SSAI plugin is configured under the src namespace.

DAI configuration

property description
type google/dai to indicate that a Google DAI stream is used
sr the DAI enabled stream
contentSrcId the contentSourceID from IMA DAI SDK used to determine the content source of the stream
videoId the videoId from IMA DAI SDK used to determine which specific video stream should be played
assetKey the assetKey from IMA DAI SDK used to determine which live stream should be played

DAI VOD sample code

Copy
Copied
var player = flowplayer('#container',
    { src: [
        { contentSrcId  : "123456"
        , videoId       : "test-video-id"
        , type          : "google/dai"
        , src           : "http://storage.googleapis.com/testtopbox-public/video_content/bbb/master.m3u8"
    }] }
  )

DAI live sample code

Copy
Copied
var player = flowplayer('#container',
    { src: [
        { assetKey  : "sN_IYUG8STe12345_ksA"
        , type      : "google/dai"
        , src       : "http://storage.googleapis.com/testtopbox-public/video_content/bbb/master.m3u8"
    }] }
  )

Yospace configuration

property description
type yospace to indicate that a Yospace stream is used
src the Yospace stream

Yospace sample code

Copy
Copied
var player = flowplayer('#container',
    { src: [
        { type  : "yospace"
        , src   : "https://csm-e-sdk-validation.bln1.yospace.com/csm/access/12345/c2FtcGxlL21hc3Rl?yo.av=3"
        }
    ]}
  )

API events

SSAI related events can be found from flowplayer.ssai.events and listened to using normal event listeners. Available events include:

event description
flowplayer.ssai.events.SSAI_AD_START fired when an ad starts to show
flowplayer.ssai.events.SSAI_AD_END fired when the current ad ends
flowplayer.ssai.events.SSAI_AD_PROGRESS fired when the current ad progresses