Skip to main content

VOD

Methods

FlowerAdsManager.requestVodAd

The function above is used before you enter VOD content.

The parameters are described below:

ParameterTypeDescription
adTagUrlstringAd tag URL issued by an ad server
contentIdstringContent’s ID
Must be registered in the FLOWER backend system
durationMsnumberTotal playback time of VOD content (milliseconds)
extraParamsmapExtra information which is agreed upon for targeting (null for no extra information)
mediaPlayerHookMediaPlayerHookAn object implementing an interface that returns a video player
adTagHeadersmap(Optional) HTTP header information to be added when requesting an ad

FlowerAdsManager.stop

This method ends VOD content playback. There are no parameters.

FlowerAdsManager.pause

This method pauses VOD content playback. There are no parameters.

FlowerAdsManager.resume

This method resumes VOD content playback. There are no parameters.

Work Process

  1. Insert replacement ads at a correct timing, consulting “Ad UI Declaration”
  2. If you need additional processing during ad playback, you can listen for events corresponding to ad playbacks or finishes by implementing the FlowerAdsManagerListener interface.
  3. Finally, pass the VOD content ID and duration information to the player through FlowerAdsManager.requestVodAd.
// TODO GUIDE: request vod ad
// arg0: adTagUrl, url from flower system.
// You must file a request to Anypoint Media to receive a adTagUrl.
// arg1: contentId, unique content id in your service
// arg2: durationMs, duration of vod content in milliseconds
// arg3: extraParams, values you can provide for targeting
// arg4: mediaPlayerHook, interface that provides currently playing segment information for ad tracking
// arg5: adTagHeaders, (Optional) values included in headers for ad request
flowerAdView.adsManager.requestVodAd(
'https://ad_request',
'100',
3600000,
null,
mediaPlayerHook,
new Map([['custom-ad-header', 'custom-ad-header-value']])
);