Class: shaka.ads.InterstitialAdManager

Constructor

new InterstitialAdManager(adContainer, basePlayer, baseVideo, onEvent)

Parameters:
Name Type Description
adContainer HTMLElement
basePlayer shaka.Player
baseVideo HTMLMediaElement
onEvent function
Implements:
Source:

Members

adContainer_ :HTMLElement

Type:
  • HTMLElement
Source:

interstitialIds_ :Set.<string>

Type:
  • Set.<string>
Source:

lastTime_ :number

Type:
  • number
Source:

onEvent_ :function(!shaka.util.FakeEvent)

Type:
  • function(!shaka.util.FakeEvent)
Source:

playingAd_ :boolean

Type:
  • boolean
Source:

usingBaseVideo_ :boolean

Type:
  • boolean
Source:

Methods

addAdUrlInterstitial(url) → {Promise}

Parameters:
Name Type Description
url string
Source:
Returns:
Type
Promise

addInterstitials(interstitialsnon-null)

Parameters:
Name Type Description
interstitials Array.<shaka.extern.AdInterstitial>
Source:

addMetadata(hlsInterstitial)

Parameters:
Name Type Description
hlsInterstitial shaka.extern.HLSInterstitial
Source:

addRegion(region)

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

configure(config)

Called by the AdManager to provide an updated configuration any time it changes.
Parameters:
Name Type Description
config shaka.extern.AdsConfiguration
Source:

createMediaElement_() → {HTMLMediaElement}

Source:
Returns:
Type
HTMLMediaElement

cuepointsChanged_()

Source:

getCurrentInterstitial_(needPreRoll, numberToSkipopt) → {shaka.extern.AdInterstitial}

Parameters:
Name Type Attributes Default Description
needPreRoll boolean
numberToSkip number <optional>
0
Source:
Returns:
Type
shaka.extern.AdInterstitial

getInterstitialsInfo_(hlsInterstitial) → {Promise.<!Array.<shaka.extern.AdInterstitial>>}

Parameters:
Name Type Description
hlsInterstitial shaka.extern.HLSInterstitial
Source:
Returns:
Type
Promise.<!Array.<shaka.extern.AdInterstitial>>

makeAdRequest_(url, contextopt) → {Promise.<BufferSource>}

Parameters:
Name Type Attributes Description
url string
context shaka.extern.RequestContext <optional>
Source:
Returns:
Type
Promise.<BufferSource>

release()

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

setupAd_(interstitial, sequenceLength, adPosition, initialTime, oncePlayedopt)

Parameters:
Name Type Attributes Default Description
interstitial shaka.extern.AdInterstitial
sequenceLength number
adPosition number
initialTime number the clock time the ad started at
oncePlayed number <optional>
0
Source:

stop()

Resets the Interstitial manager and removes any continuous polling.
Source:

updatePlayerConfig_()

Source:

Type Definitions

Asset

Type:
  • {URI: string}
Properties:
Name Type Description
URI string
Source:

AssetsList

Type:
Properties:
Name Type Description
ASSETS Array.<shaka.ads.InterstitialAdManager.Asset>
Source: