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. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_BUFFERING :string

The event name for when the ad is buffering. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_CLICKED :string

The event name for when the ad was clicked. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_CLOSED :string

The event name for when the ad was closed by the user. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_COMPLETE :string

The event name for when an ad has completed playing. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_CONTENT_ATTACH_REQUESTED :string

The name of the event for when an ad requires the video of the main content to be attached. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_CONTENT_PAUSE_REQUESTED :string

The name of the event for when an ad requires the main content to be paused. Fired when the platform does not support multiple media elements. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_CONTENT_RESUME_REQUESTED :string

The name of the event for when an ad requires the main content to be resumed. Fired when the platform does not support multiple media elements. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_DURATION_CHANGED :string

The event name for when the ad's duration changed. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_ERROR :string

The event name for when the ad manager dispatch errors. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_FIRST_QUARTILE :string

The event name for when an ad playhead crosses first quartile. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_IMPRESSION :string

The event name for when the ad's URL was hit. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_INTERACTION :string

The event name for when the interaction callback for the ad was triggered. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_LINEAR_CHANGED :string

The event name for when the ad changes from or to linear. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_LOADED :string

The event name for when the ad data becomes available. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_METADATA :string

The event name for when the ad's metadata becomes available. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_MIDPOINT :string

The event name for when an ad playhead crosses midpoint. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_MUTED :string

The event name for when the ad was muted. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_PAUSED :string

The event name for when the ad was paused. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_PROGRESS :string

The event name for when there is an update to the current ad's progress. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_RECOVERABLE_ERROR :string

The event name for when the ad display encountered a recoverable error. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_RESUMED :string

The event name for when the ad was resumed after a pause. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
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). Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_SKIPPED :string

The event name for when an ad is skipped by the user. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_STARTED :string

The event name for when an ad has started playing. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
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). Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_THIRD_QUARTILE :string

The event name for when an ad playhead crosses third quartile. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

AD_VOLUME_CHANGED :string

The event name for when the ad volume has changed. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

ADS_LOADED :string

The event name for when a sequence of ads has been loaded. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

ALL_ADS_COMPLETED :string

The event name for when all the ads were completed. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

CUEPOINTS_CHANGED :string

The event name for when the ad's cue points (start/end markers) have changed. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

IMA_AD_MANAGER_LOADED :string

The event name for when the native IMA ad manager object has loaded and become available. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

IMA_STREAM_MANAGER_LOADED :string

The event name for when the native IMA stream manager object has loaded and become available. Deprecated, please use shaka.ads.Utils
Type:
  • string
Deprecated:
  • Yes
Source:

locale_ :string

locale
Type:
  • string
Source:

Methods

addMediaTailorTrackingUrl(url)

Parameters:
Name Type Description
url string
Implements:
Source:

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:

initInterstitial(adContainernullable, basePlayernon-null, baseVideonon-null)

Parameters:
Name Type Attributes Description
adContainer HTMLElement <nullable>
basePlayer shaka.Player
baseVideo HTMLMediaElement
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:

onInterstitialMetadata(basePlayernon-null, baseVideonon-null, interstitial)

Parameters:
Name Type Description
basePlayer shaka.Player
baseVideo HTMLMediaElement
interstitial shaka.extern.Interstitial
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

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:

AdContentPauseRequestedEvent

Fired when the ad requires the main content to be paused. Fired when the platform does not support multiple media elements.
Properties:
Name Type Attributes Description
type string 'ad-content-pause-requested'
saveLivePosition boolean <nullable>
Indicates whether the live position has to be saved or not.
Source:

AdContentResumeRequestedEvent

Fired when the ad requires the main content to be resumed. Fired when the platform does not support multiple media elements.
Properties:
Name Type Attributes Description
type string 'ad-content-resume-requested'
offset number <nullable>
Indicates the offset that should be applied to the previously saved time.
Source:

AdContentResumeRequestedEvent

Fired when the ad requires the video of the main content to be attached.
Properties:
Name Type Description
type string 'ad-content-attach-requested'
Source:

AdCuePointsChangedEvent

Fired when the ad cue points change, signalling ad breaks change.
Properties:
Name Type Description
type string 'ad-cue-points-changed'
cuepoints Array.<!shaka.extern.AdCuePoint> The ad cue points, 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:

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: