Class: shaka.ads.AdManager

Constructor

new AdManager()

Implements:
Source:

Members

AD_BREAK_READY :string

The event name for when the client side SDK signalled its readiness to play a VPAID ad or an ad rule.
Type:
  • string
Source:

AD_BUFFERING :string

The event name for when the ad is buffering.
Type:
  • string
Source:

AD_CLICKED :string

The event name for when the ad was clicked.
Type:
  • string
Source:

AD_CLOSED :string

The event name for when the ad was closed by the user.
Type:
  • string
Source:

AD_COMPLETE :string

The event name for when an ad has completed playing.
Type:
  • string
Source:

AD_DURATION_CHANGED :string

The event name for when the ad's duration changed.
Type:
  • string
Source:

AD_ERROR :string

The event name for when the ad manager dispatch errors.
Type:
  • string
Source:

AD_FIRST_QUARTILE :string

The event name for when an ad playhead crosses first quartile.
Type:
  • string
Source:

AD_IMPRESSION :string

The event name for when the ad's URL was hit.
Type:
  • string
Source:

AD_INTERACTION :string

The event name for when the interaction callback for the ad was triggered.
Type:
  • string
Source:

AD_LINEAR_CHANGED :string

The event name for when the ad changes from or to linear.
Type:
  • string
Source:

AD_LOADED :string

The event name for when the ad data becomes available.
Type:
  • string
Source:

AD_METADATA :string

The event name for when the ad's metadata becomes available.
Type:
  • string
Source:

AD_MIDPOINT :string

The event name for when an ad playhead crosses midpoint.
Type:
  • string
Source:

AD_MUTED :string

The event name for when the ad was muted.
Type:
  • string
Source:

AD_PAUSED :string

The event name for when the ad was paused.
Type:
  • string
Source:

AD_PROGRESS :string

The event name for when there is an update to the current ad's progress.
Type:
  • string
Source:

AD_RECOVERABLE_ERROR :string

The event name for when the ad display encountered a recoverable error.
Type:
  • string
Source:

AD_RESUMED :string

The event name for when the ad was resumed after a pause.
Type:
  • string
Source:

AD_SKIP_STATE_CHANGED :string

The event name for when the ad's skip status changes (usually it becomes skippable when it wasn't before).
Type:
  • string
Source:

AD_SKIPPED :string

The event name for when an ad is skipped by the user..
Type:
  • string
Source:

AD_STARTED :string

The event name for when an ad has started playing.
Type:
  • string
Source:

AD_STOPPED :string

The event name for when an ad has finished playing (played all the way through, was skipped, or was unable to proceed due to an error).
Type:
  • string
Source:

AD_THIRD_QUARTILE :string

The event name for when an ad playhead crosses third quartile.
Type:
  • string
Source:

AD_VOLUME_CHANGED :string

The event name for when the ad volume has changed.
Type:
  • string
Source:

ADS_LOADED :string

The event name for when a sequence of ads has been loaded.
Type:
  • string
Source:

ALL_ADS_COMPLETED :string

The event name for when all the ads were completed.
Type:
  • string
Source:

CUEPOINTS_CHANGED :string

The event name for when the ad's cue points (start/end markers) have changed.
Type:
  • string
Source:

IMA_AD_MANAGER_LOADED :string

The event name for when the native IMA ad manager object has loaded and become available.
Type:
  • string
Source:

IMA_STREAM_MANAGER_LOADED :string

The event name for when the native IMA stream manager object has loaded and become available.
Type:
  • string
Source:

locale_ :string

locale
Type:
  • string
Source:

Methods

configure(config)

Called by the Player to provide an updated configuration any time it changes. Must be called at least once before init*().
Parameters:
Name Type Description
config shaka.extern.AdsConfiguration
Implements:
Source:

getCuePoints() → {Array.<!shaka.extern.AdCuePoint>}

Implements:
Source:
Returns:
Type
Array.<!shaka.extern.AdCuePoint>

getServerSideCuePoints() → {Array.<!shaka.extern.AdCuePoint>}

Implements:
Source:
Returns:
Type
Array.<!shaka.extern.AdCuePoint>

getStats() → {shaka.extern.AdsStats}

Get statistics for the current playback session. If the player is not playing content, this will return an empty stats object.
Implements:
Source:
Returns:
Type
shaka.extern.AdsStats

initClientSide(adContainernon-null, videonon-null, adsRenderingSettingsnullable)

Parameters:
Name Type Attributes Description
adContainer HTMLElement
video HTMLMediaElement
adsRenderingSettings google.ima.AdsRenderingSettings <nullable>
Implements:
Source:

initMediaTailor(adContainernon-null, networkingEnginenon-null, videonon-null)

Parameters:
Name Type Description
adContainer HTMLElement
networkingEngine shaka.net.NetworkingEngine
video HTMLMediaElement
Implements:
Source:

initServerSide(adContainernon-null, videonon-null)

Parameters:
Name Type Description
adContainer HTMLElement
video HTMLMediaElement
Implements:
Source:

onAssetUnload()

Source:

onCueMetadataChange(value)

Parameters:
Name Type Description
value shaka.extern.MetadataFrame
Implements:
Source:

onDashTimedMetadata(region)

Parameters:
Name Type Description
region shaka.extern.TimelineRegionInfo
Implements:
Source:

onHlsTimedMetadata(metadata, timestampOffset)

Parameters:
Name Type Description
metadata shaka.extern.ID3Metadata
timestampOffset number
Implements:
Source:

onManifestUpdated(isLive)

Fired when the manifest is updated.
Parameters:
Name Type Description
isLive boolean
Implements:
Source:

processAndDispatchEvent_(eventnon-null)

Parameters:
Name Type Description
event shaka.util.FakeEvent
Source:

release()

Request that this object release all internal references.
Implements:
Source:

replaceServerSideAdTagParameters(adTagParameters)

Parameters:
Name Type Description
adTagParameters Object
Implements:
Source:

requestClientSideAds(imaRequestnon-null)

Parameters:
Name Type Description
imaRequest google.ima.AdsRequest
Implements:
Source:

requestMediaTailorStream(url, adsParams, backupUrlopt) → {Promise.<string>}

Parameters:
Name Type Attributes Description
url string
adsParams Object
backupUrl string <optional>
Implements:
Source:
Returns:
Type
Promise.<string>

requestServerSideStream(imaRequestnon-null, backupUrlopt) → {Promise.<string>}

Parameters:
Name Type Attributes Description
imaRequest google.ima.dai.api.StreamRequest
backupUrl string <optional>
Implements:
Source:
Returns:
Type
Promise.<string>

setLocale(locale)

Parameters:
Name Type Description
locale string
Implements:
Source:

updateClientSideAdsRenderingSettings(adsRenderingSettingsnon-null)

Parameters:
Name Type Description
adsRenderingSettings google.ima.AdsRenderingSettings
Implements:
Source:

Events

AD_ERROR

Fired when a fatal error is encountered.
Properties:
Name Type Description
type string 'ad-error'
originalEvent Object The native SDK event, if available.
Source:

AdBufferingEvent

Fired when the ad has stalled playback to buffer.
Properties:
Name Type Description
type string 'ad-buffering'
originalEvent Object The native SDK event, if available.
Source:

AdClickedEvent

Fired when the ad was clicked.
Properties:
Name Type Description
type string 'ad-clicked'
Source:

AdClickEvent

Fired when the ad was clicked.
Properties:
Name Type Description
type string 'ad-clicked'
originalEvent Object The native SDK event, if available.
Source:

AdClosedEvent

Fired when the ad was closed by the user.
Properties:
Name Type Description
type string 'ad-closed'
originalEvent Object The native SDK event, if available.
Source:

AdCompleteEvent

Fired when an ad has played through.
Properties:
Name Type Description
type string 'ad-complete'
originalEvent Object The native SDK event, if available.
Source:

AdDurationChangedEvent

Fired when the ad's duration changes.
Properties:
Name Type Description
type string 'ad-duration-changed'
originalEvent Object The native SDK event, if available.
Source:

AdFirstQuartileEvent

Fired when an ad has played through the first 1/4.
Properties:
Name Type Description
type string 'ad-first-quartile'
originalEvent Object The native SDK event, if available.
Source:

AdImpressionEvent

Fired when the impression URL has been pinged.
Properties:
Name Type Description
type string 'ad-impression'
originalEvent Object The native SDK event, if available.
Source:

AdInteractionEvent

Fired when an ad triggers the interaction callback.
Properties:
Name Type Description
type string 'ad-interaction'
originalEvent Object The native SDK event, if available.
Source:

AdLinearChangedEvent

Fired when the displayed ad changes from linear to nonlinear, or vice versa.
Properties:
Name Type Description
type string 'ad-linear-changed'
originalEvent Object The native SDK event, if available.
Source:

AdLoadedEvent

Fired when the ad data becomes available.
Properties:
Name Type Description
type string 'ad-loaded'
originalEvent Object The native SDK event, if available.
Source:

AdMetadataEvent

Fired when the ad's metadata becomes available.
Properties:
Name Type Description
type string 'ad-metadata'
originalEvent Object The native SDK event, if available.
Source:

AdMidpointEvent

Fired when an ad has played through its midpoint.
Properties:
Name Type Description
type string 'ad-midpoint'
originalEvent Object The native SDK event, if available.
Source:

AdMutedEvent

Fired when an ad was muted.
Properties:
Name Type Description
type string 'ad-muted'
originalEvent Object The native SDK event, if available.
Source:

AdPausedEvent

Fired when an ad was paused.
Properties:
Name Type Description
type string 'ad-paused'
originalEvent Object The native SDK event, if available.
Source:

AdProgressEvent

Fired when there is an update to the current ad's progress.
Properties:
Name Type Description
type string 'ad-progress'
originalEvent Object The native SDK event, if available.
Source:

AdRecoverableErrorEvent

Fired when the a non-fatal error was encountered. The presentation will continue with the same or next ad playback depending on the error situation.
Properties:
Name Type Description
type string 'ad-recoverable-error'
originalEvent Object The native SDK event, if available.
Source:

AdResumedEvent

Fired when an ad was resumed after a pause.
Properties:
Name Type Description
type string 'ad-resumed'
originalEvent Object The native SDK event, if available.
Source:

AdResumedEvent

Fired when the ad cue points change, signalling ad breaks change.
Properties:
Name Type Description
type string 'ad-cue-points-changed'
originalEvent Object The native SDK event, if available.
Source:

AdSkippedEvent

Fired when an ad has been skipped.
Properties:
Name Type Description
type string 'ad-skipped'
originalEvent Object The native SDK event, if available.
Source:

AdSkipStateChangedEvent

Fired when an ad's skip state changes (for example, when it becomes possible to skip the ad).
Properties:
Name Type Description
type string 'ad-skip-state-changed'
originalEvent Object The native SDK event, if available.
Source:

AdsLoadedEvent

Fired when a sequence of ads has been loaded.
Properties:
Name Type Description
type string 'ads-loaded'
loadTime number The time it takes to load ads.
Source:

AdStartedEvent

Fired when an ad has started playing.
Properties:
Name Type Description
type string 'ad-started'
ad shaka.extern.IAd The ad that has started playing.
sdkAdObject Object The ad object in the SDK format, if there is one.
originalEvent Object The native SDK event, if available.
Source:

AdStoppedEvent

Fired when an ad has stopped playing, was skipped, or was unable to proceed due to an error.
Properties:
Name Type Description
type string 'ad-stopped'
originalEvent Object The native SDK event, if available.
Source:

AdThirdQuartileEvent

Fired when an ad has played through the third quartile.
Properties:
Name Type Description
type string 'ad-third-quartile'
originalEvent Object The native SDK event, if available.
Source:

AdVolumeChangedEvent

Fired when an ad's volume changed.
Properties:
Name Type Description
type string 'ad-volume-changed'
originalEvent Object The native SDK event, if available.
Source:

AllAdsCompletedEvent

Fired when the ads manager is done playing all the ads.
Properties:
Name Type Description
type string 'all-ads-completed'
originalEvent Object The native SDK event, if available.
Source:

AdBreakReadyEvent

Fired when the client-side SDK is ready to play a VPAID ad or an ad rule.
Properties:
Name Type Description
type string 'ad-break-ready'
originalEvent Object The native SDK event, if available.
Source:

ImaAdManagerLoadedEvent

Fired when the native IMA ad manager becomes available.
Properties:
Name Type Description
type string 'ima-ad-manager-loaded'
imaAdManager Object The native IMA ad manager.
Source:

ImaStreamManagerLoadedEvent

Fired when the native IMA stream manager becomes available.
Properties:
Name Type Description
type string 'ima-stream-manager-loaded'
imaStreamManager Object The native IMA stream manager.
Source: