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:

baseVideo_ :HTMLVideoElement

Type:
  • HTMLVideoElement
Source:

baseVideo_ :HTMLVideoElement

Type:
  • HTMLVideoElement
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:

addOverlayRegion(region)

Parameters:
Name Type Description
region shaka.extern.TimelineRegionInfo
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:

determineIfUsingBaseVideo_()

Source:

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

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

getInterstitials() → {Array.<shaka.extern.AdInterstitial>}

Only for testing
Source:
Returns:
Type
Array.<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>>

isPreloadAllowed_(interstitialnon-null) → {boolean}

Parameters:
Name Type Description
interstitial shaka.extern.AdInterstitial
Source:
Returns:
Type
boolean

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:

setupStaticAd_(interstitial, sequenceLength, adPosition, oncePlayed)

Parameters:
Name Type Description
interstitial shaka.extern.AdInterstitial
sequenceLength number
adPosition number
oncePlayed number
Source:

setupVideoAd_(interstitial, sequenceLength, adPosition, initialTime, oncePlayed)

Parameters:
Name Type Description
interstitial shaka.extern.AdInterstitial
sequenceLength number
adPosition number
initialTime number the clock time the ad started at
oncePlayed number
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:

SkipControl

Type:
  • {ENABLE-SKIP-AFTER: number, ENABLE-SKIP-FOR: number}
Properties:
Name Type Description
ENABLE-SKIP-AFTER number
ENABLE-SKIP-FOR number
Source: