Class: shaka.ads.AdManager

Constructor

new AdManager()

Implements:
Source:

Members

AD_COMPLETE :string

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

AD_FIRST_QUARTILE :string

The event name for when an ad playhead crosses first quartile.
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_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:

CUEPOINTS_CHANGED :string

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

locale_ :string

locale
Type:
  • string
Source:

Methods

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)

Parameters:
Name Type Description
adContainer HTMLElement
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.ID3Metadata
Implements:
Source:

onDashTimedMetadata(region)

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

onHlsTimedMetadata(metadatanon-null, timestampOffset)

Parameters:
Name Type Description
metadata Array.<shaka.extern.ID3Metadata>
timestampOffset number
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:

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:

Events

AdCompleteEvent

Fired when an ad has played through.
Properties:
Name Type Description
type string 'ad-complete'
Source:

AdFirstQuartileEvent

Fired when an ad has played through the first 1/4.
Properties:
Name Type Description
type string 'ad-first-quartile'
Source:

AdMidpointEvent

Fired when an ad has played through its midpoint.
Properties:
Name Type Description
type string 'ad-midpoint'
Source:

AdMutedEvent

Fired when an ad was muted.
Properties:
Name Type Description
type string 'ad-muted'
Source:

AdPausedEvent

Fired when an ad was paused.
Properties:
Name Type Description
type string 'ad-paused'
Source:

AdResumedEvent

Fired when an ad was resumed after a pause.
Properties:
Name Type Description
type string 'ad-resumed'
Source:

AdResumedEvent

Fired when the ad cue points change, signalling ad breaks change.
Properties:
Name Type Description
type string 'ad-cue-points-changed'
Source:

ADS_LOADED

Fired when an ad has started playing.
Properties:
Name Type Description
type string 'ads-loaded'
loadTime number The time it takes to load ads.
Source:

AdSkippedEvent

Fired when an ad has been skipped.
Properties:
Name Type Description
type string 'ad-skipped'
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'
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.
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'
Source:

AdThirdQuartileEvent

Fired when an ad has played through the third quartile.
Properties:
Name Type Description
type string 'ad-third-quartile'
Source:

AdVolumeChangedEvent

Fired when an ad's volume changed.
Properties:
Name Type Description
type string 'ad-volume-changed'
Source: