Constructor
new InterstitialAdManager(adContainer, basePlayer, baseVideo, onEvent)
Parameters:
| Name | Type | Description | 
|---|---|---|
adContainer | 
            
            HTMLElement | |
basePlayer | 
            
            shaka.Player | |
baseVideo | 
            
            HTMLMediaElement | |
onEvent | 
            
            function | 
- Implements:
 - Source:
 
Members
adEventManager_ :shaka.util.EventManager
Type:
adVideo_ :HTMLMediaElement
Type:
baseVideo_ :HTMLMediaElement
Type:
baseVideo_ :HTMLVideoElement
Type:
- HTMLVideoElement
 
baseVideo_ :HTMLVideoElement
Type:
- HTMLVideoElement
 
baseVideo_ :HTMLVideoElement
Type:
- HTMLVideoElement
 
config_ :shaka.extern.AdsConfiguration
Type:
eventManager_ :shaka.util.EventManager
Type:
interstitialIds_ :Set.<string>
Type:
- Set.<string>
 
interstitials_ :Set.<shaka.extern.AdInterstitial>
Type:
lastPlayedAd_ :shaka.extern.AdInterstitial
Type:
onEvent_ :function(!shaka.util.FakeEvent)
Type:
- function(!shaka.util.FakeEvent)
 
playoutLimitTimer_ :shaka.util.Timer
Type:
pollTimer_ :shaka.util.Timer
Type:
preloadManagerInterstitials_ :Map.<shaka.extern.AdInterstitial, Promise.<?shaka.media.PreloadManager>>
Type:
- Map.<shaka.extern.AdInterstitial, Promise.<?shaka.media.PreloadManager>>
 
preloadOnDomElements_ :Map.<shaka.extern.AdInterstitial, !Array.<!HTMLLinkElement>>
Type:
- Map.<shaka.extern.AdInterstitial, !Array.<!HTMLLinkElement>>
 
timeUpdateTimer_ :shaka.util.Timer
Type:
Methods
addAdUrlInterstitial(url) → {Promise}
Parameters:
| Name | Type | Description | 
|---|---|---|
url | 
            
            string | 
Returns:
- Type
 - Promise
 
addEventListeners_()
addInterstitials(interstitialsnon-null)
Parameters:
| Name | Type | Description | 
|---|---|---|
interstitials | 
            
            Array.<shaka.extern.AdInterstitial> | 
addMetadata(hlsInterstitial)
Parameters:
| Name | Type | Description | 
|---|---|---|
hlsInterstitial | 
            
            shaka.extern.HLSInterstitial | 
checkForInterstitials_()
checkPreloadOnDomElements_(interstitialnon-null)
Parameters:
| Name | Type | Description | 
|---|---|---|
interstitial | 
            
            shaka.extern.AdInterstitial | 
configure(config)
    Called by the AdManager to provide an updated configuration any time it
changes.
    Parameters:
| Name | Type | Description | 
|---|---|---|
config | 
            
            shaka.extern.AdsConfiguration | 
cuepointsChanged_()
determineIfUsingBaseVideo_()
getCurrentInterstitial_(needPreRollopt, numberToSkipopt, nullable) → {shaka.extern.AdInterstitial}
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
needPreRoll | 
            
            boolean | 
                
                    <optional> | 
            
            
                false | |
numberToSkip | 
            
            number | 
                
                    <optional> <nullable>  | 
            
            
                null | 
Returns:
getInterstitials() → {Array.<shaka.extern.AdInterstitial>}
    Only for testing
Returns:
- Type
 - Array.<shaka.extern.AdInterstitial>
 
getInterstitialsInfo_(hlsInterstitial) → {Promise.<!Array.<shaka.extern.AdInterstitial>>}
Parameters:
| Name | Type | Description | 
|---|---|---|
hlsInterstitial | 
            
            shaka.extern.HLSInterstitial | 
Returns:
- Type
 - Promise.<!Array.<shaka.extern.AdInterstitial>>
 
isPreloadAllowed_(interstitialnon-null) → {boolean}
Parameters:
| Name | Type | Description | 
|---|---|---|
interstitial | 
            
            shaka.extern.AdInterstitial | 
Returns:
- Type
 - boolean
 
makeAdRequest_(url, contextopt) → {Promise.<BufferSource>}
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
url | 
            
            string | ||
context | 
            
            shaka.extern.RequestContext | 
                
                    <optional> | 
            
            
            
Returns:
- Type
 - Promise.<BufferSource>
 
onTimeUpdate_()
release()
    Request that this object release all internal references.
- Implements:
 - Source:
 
removeBaseStyles_(interstitialopt, nullable)
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
interstitial | 
            
            shaka.extern.AdInterstitial | 
                
                    <optional> <nullable>  | 
            
            
            
removeEventListeners_()
removePreloadOnDomElements_(interstitialnon-null)
Parameters:
| Name | Type | Description | 
|---|---|---|
interstitial | 
            
            shaka.extern.AdInterstitial | 
setBaseStyles_(interstitial)
Parameters:
| Name | Type | Description | 
|---|---|---|
interstitial | 
            
            shaka.extern.AdInterstitial | 
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 | 
setupStaticAd_(interstitial, sequenceLength, adPosition, oncePlayed)
Parameters:
| Name | Type | Description | 
|---|---|---|
interstitial | 
            
            shaka.extern.AdInterstitial | |
sequenceLength | 
            
            number | |
adPosition | 
            
            number | |
oncePlayed | 
            
            number | 
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 | 
stop()
    Resets the Interstitial manager and removes any continuous polling.
updatePlayerConfig_()
Type Definitions
Asset
Type:
- {URI: string}
 
Properties:
| Name | Type | Description | 
|---|---|---|
URI | 
            
            
            string | 
AssetsList
Type:
- {ASSETS: !Array.<shaka.ads.InterstitialAdManager.Asset>, SKIP-CONTROL: ?shaka.ads.InterstitialAdManager.SkipControl}
 
Properties:
| Name | Type | Description | 
|---|---|---|
ASSETS | 
            
            
            Array.<shaka.ads.InterstitialAdManager.Asset> | |
SKIP-CONTROL | 
            
            
            shaka.ads.InterstitialAdManager.SkipControl | 
SkipControl
Type:
- {ENABLE-SKIP-AFTER: number, ENABLE-SKIP-FOR: number}
 
Properties:
| Name | Type | Description | 
|---|---|---|
ENABLE-SKIP-AFTER | 
            
            
            number | |
ENABLE-SKIP-FOR | 
            
            
            number |