Skip to content

Latest commit

 

History

History
549 lines (325 loc) · 11.9 KB

api.md

File metadata and controls

549 lines (325 loc) · 11.9 KB

Table of Contents

google.ima.CompanionAdSelectionSettings.SizeCriteria

google.ima.CompanionAdSelectionSettings.SizeCriteria

CompanionsConfigObject

Type: Object

Parameters

Examples

{
  sizeCriteria: 'SELECT_EXACT_MATCH',
  ads: {
    testCompanionSquare: {
      width: 300,
      height: 250
    },
    testCompanionLong: {
      width: 728,
      height: 90
    }
  }
}

CompanionAdObject

Type: Object

Parameters

  • width number Width of the companion ad.
  • height number Height of the companion ad.

google.ima.AdsRenderingSettings

google.ima.AdsRenderingSettings

google.ima.ImaSdkSettings.VpaidMode

google.ima.ImaSdkSettings.VpaidMode

ImaConfigObject

Type: Object

Parameters

  • adTagUrl string Specifies the ad tag url that is requested from the ad server.

  • adsResponse string? Specifies a VAST 2.0 document to be used as the ads response instead of making a request via an ad tag url (if adTagUrl is not set).

  • debug boolean If set to true, loads IMA SDK in debug mode. (optional, default false)

  • disableMediaPreload boolean Whether to disable media pre loading while ad is playing. If set to true, the player will start loading the content media just after the ad break will end (incase of preroll ad). This will also overrides config.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete no matters its value and sets it to false. (optional, default false)

  • forceReloadMediaAfterAds boolean force reload our media after ads finish. (optional, default false)

  • delayInitUntilSourceSelected boolean wait until the video tag loaded and then load Ima. (optional, default false)

  • vpaidMode google.ima.ImaSdkSettings.VpaidMode Sets VPAID playback mode See usage also in Handling VPAID Modes. (optional, default 'ENABLED')

  • numRedirects google.ima.ImaSdkSettings.numRedirects Specifies the maximum number of redirects before the subsequent redirects will be denied, and the ad load aborted. This applies to all VAST wrapper ads. (optional, default 4)

  • adsRenderingSettings google.ima.AdsRenderingSettings Defines parameters that control the rendering of ads. (optional, default { restoreCustomPlaybackStateOnAdBreakComplete:true, enablePreloading:false, useStyledLinearAds:false, useStyledNonLinearAds:true bitrate:-1, autoAlign:true })

  • companions CompanionsConfigObject? Defines the companion ads.

  • locale string? Sets the publisher provided locale. The locale specifies the language in which to display UI elements and can be any two-letter ISO 639-1 code.

  • showAdBreakCuePoint boolean? Whether to show the ad breaks cue points.

  • adBreakCuePointStyle Object? Style options for the ad breaks cue points - See the options Here.

  • sessionId string? a temporary random ID. It is used exclusively for frequency capping. A session ID must be a UUID.

  • omidAccessModes OmidAccessModesConfig? A dictionary that maps each OmidVerificationVendor to one of the access modes

AccessMode

different access modes for verification scripts

Type: ("FULL" | "CREATIVE" | "DOMAIN" | "LIMITED")

OmidAccessModesConfig

A dictionary that maps each OmidVerificationVendor to one of the available access modes

Examples

{
  MOAT: 'FULL'
  PIXELATE: 'CREATIVE'
  OTHER: 'DOMAIN'
}

ImaAdsController

Controller for ima plugin.

Parameters

  • context Ima The ima plugin context.

skipAd

Skip on an ad.

Returns void

playAdNow

Play an ad on demand.

Parameters

  • adPod KPAdPod The ad pod to play.

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

ImaEngineDecorator

Engine decorator for ima plugin.

Parameters

  • engine IEngine The HTML5 engine.
  • plugin Ima The ima plugin.

paused

Get paused state.

Type: boolean

Returns boolean The paused value of the engine.

currentTime

Get the current time in seconds.

Type: number

Returns number The current playback time.

currentTime

Set the current time in seconds.

Type: number

Parameters

  • to number The number to set in seconds.

Returns void

duration

Get the duration in seconds.

Type: number

Returns number The playback duration.

ended

Get ended state

Type: boolean

Returns boolean media ended

Ima

Extends BasePlugin

The ima plugin.

Parameters

  • name string The plugin name.
  • player Player The player instance.
  • config ImaConfigObject The plugin config.

getEngineDecorator

Gets the engine decorator.

Parameters

  • engine IEngine The engine to decorate.

Returns IEngineDecorator The ads api.

getMiddlewareImpl

Gets the middleware.

Returns ImaMiddleware The middleware api.

getAdsController

Gets the ads controller.

Returns IAdsPluginController The ads api.

playAdNow

Plays ad on demand

Parameters

  • adPod KPAdPod The ad pod to play.

Returns void

skipAd

Skips on an ad.

Returns void

resumeAd

Resuming the ad.

Returns DeferredPromise The promise which when resolved starts the next handler in the middleware chain.

pauseAd

Pausing the ad.

Returns DeferredPromise The promise which when resolved starts the next handler in the middleware chain.

getStateMachine

Gets the state machine.

Returns any The state machine.

playOnMainVideoTag

Gets the indicator if ads playing on the main video tag

Returns boolean if ads playing on the main video tag.

isAdPlaying

Gets the indicator if ads still playing.

Returns boolean if ads still playing.

loadMedia

Prepare the plugin before media is loaded.

Returns void

reset

Resets the plugin.

Returns void

destroy

Destroys the plugin.

Returns void

initialUserAction

Initialize the ads for the first time.

Returns DeferredPromise? The promise which when resolved starts the next handler in the middleware chain.

onPlaybackEnded

Ended event handler.

Returns Promise<void> complete promise

defaultConfig

The default configuration of the plugin.

Type: Object

loadPromise

Promise for loading the plugin. Will be resolved after:

  1. Ima script has been loaded in the page.
  2. The ads manager has been loaded and ready to start.

Type: Promise<any>

isValid

Whether the ima plugin is valid.

State

The ima plugin possible states.

Type: Object