Skip to content

Latest commit

 

History

History
408 lines (270 loc) · 9.08 KB

api.md

File metadata and controls

408 lines (270 loc) · 9.08 KB

Table of Contents

ImaDAIConfigObject

Type: Object

Parameters

  • assetKey string This is used to determine which stream should be played. The live stream request asset key is an identifier which can be found in the DFP UI.
  • contentSourceId string Unique identifier for the publisher content, from a CMS. Required for on-demand streams.
  • videoId string Identifier for the video content source. Required for on-demand streams.
  • snapback boolean Prevent your viewers from seeking past your mid-roll ads. (optional, default true)
  • debug boolean Loads IMA-DAI SDK in debug mode. (optional, default false)
  • adTagParameters Object You can override a limited set of ad tag parameters on your stream request. Supply targeting parameters to your stream provides more information. You can use the dai-ot and dai-ov parameters for stream variant preference. See Override Stream Variant Parameters for more information.
  • apiKey string The stream request API key. It's configured through the DFP Admin UI. and provided to the publisher to unlock their content. It verifies the applications that are attempting to access the content.
  • streamActivityMonitorId string The ID to be used to debug the stream with the stream activity monitor.
  • authToken string The stream request authorization token. Used in place of the API key for stricter content authorization. The publisher can control individual content streams authorizations based on this token.
  • format string The stream format to request. (optional) Accepts the following string values - hls, dash (Values must be lowercase.). (optional, default 'hls')
  • locale string? Sets the publisher provided locale. The locale specifies the language in which to display UI elements and can be any two-letter {@link https://www.loc.gov/standards/iso639-2/php/English_list.php|ISO 639-1} code.
  • showAdBreakCuePoint boolean? Whether to show the ad breaks cue points in the ui timeline.
  • adBreakCuePointStyle Object? Style options for the ad breaks cue points - See the options Here.

Examples

plugins: {
  imadai: {
    assetKey: 'sN_IYUG8STe1ZzhIIE_ksA',
    contentSourceId: '2477953',
    videoId: 'tears-of-steel'
  }
}

ImaDAIAdsController

Controller for ima dai plugin.

Parameters

  • context ImaDAI The ima dai plugin context.

skipAd

Skip on an ad.

Returns void

playAdNow

Play an ad on demand.

Returns void

onPlaybackEnded

On playback ended handler.

Returns Promise<void> complete promise

active

Whether this ads controller is active

Type: boolean

Returns boolean is active

done

Whether this ads controller is done

Type: boolean

Returns boolean is done

name

The controller name

Type: string

Returns string The name

ImaDAIEngineDecorator

Engine decorator for ima dai plugin.

Parameters

  • engine IEngine The HTML5 engine.
  • plugin ImaDAI The ima dai plugin.
  • dispatchEventHandler Function A dispatch event handler

load

Load media.

Parameters

  • startTime number Optional time to start the video from.

Returns Promise<Object> The loaded data

dispatchEvent

Dispatch an event from this object.

Parameters

  • event Event The event to be dispatched from this object.

Returns boolean True if the default action was prevented.

pause

Pause playback.

Returns void

play

Start/resume playback.

Returns void

reset

Resets the engine decorator.

Returns void

destroy

Destroys the engine decorator.

Returns void

paused

Get paused state.

Type: boolean

Returns boolean The paused value of the engine.

ended

Get ended state.

Type: boolean

Returns boolean The ended value of the engine.

currentTime

Set the current time in seconds.

Type: number

Parameters

  • to number The number to set in seconds.

Returns void

currentTime

Get the current time in seconds.

Type: number

Returns number The current playback time.

duration

Get the duration in seconds.

Type: number

Returns number The playback duration.

ImaDAIState

The ima DAI plugin possible states.

Type: Object

ImaDAI

Extends BasePlugin

The ima-dai plugin.

Parameters

getEngineDecorator

Gets the engine decorator.

Parameters

  • engine IEngine The engine to decorate.
  • dispatchEventHandler Function A dispatch event handler

Returns IEngineDecorator The ads api.

getAdsController

Gets the ads controller.

Returns IAdsPluginController The ads api.

getStreamUrl

Gets the stream URL from ima-dai SDK.

Returns Promise<string> A promise of the URL to play.

state

Gets the plugin state.

Type: string

Returns string The state.

skipAd

Skips on an ad.

Returns void

pauseAd

Pausing the ad.

Returns void

resumeAd

Resuming the ad.

Returns void

getStreamTime

Returns the stream time with ads for a given content time. Returns the given content time for live streams.

Parameters

  • contentTime number the content time without any ads (in seconds).

Returns number The stream time that corresponds with the given content time once ads are inserted.

getContentTime

Returns the content time without ads for a given stream time. Returns the given stream time for live streams.

Parameters

  • streamTime number the stream time with inserted ads (in seconds).

Returns number The content time that corresponds with the given stream time once ads are removed.

isAdBreak

Whether the player is in an ad break.

Returns boolean Is ad break.

reset

Resets the plugin.

Returns void

destroy

Destroys the plugin.

Returns void

isValid

Whether the ima-dai plugin is valid.

defaultConfig

The default configuration of the plugin.

Type: Object