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:
eventManager_ :shaka.util.EventManager
Type:
interstitialIds_ :Set.<string>
Type:
- Set.<string>
 
interstitials_ :Set.<shaka.extern.AdInterstitial>
Type:
onEvent_ :function(!shaka.util.FakeEvent)
Type:
- function(!shaka.util.FakeEvent)
 
pollTimer_ :shaka.util.Timer
Type:
preloadManagerInterstitials_ :Map.<shaka.extern.AdInterstitial, Promise.<?shaka.media.PreloadManager>>
Type:
- Map.<shaka.extern.AdInterstitial, Promise.<?shaka.media.PreloadManager>>
 
Methods
addAdUrlInterstitial(url) → {Promise}
Parameters:
| Name | Type | Description | 
|---|---|---|
url | 
            
            string | 
Returns:
- Type
 - Promise
 
addInterstitials(interstitialsnon-null)
Parameters:
| Name | Type | Description | 
|---|---|---|
interstitials | 
            
            Array.<shaka.extern.AdInterstitial> | 
addMetadata(hlsInterstitial)
Parameters:
| Name | Type | Description | 
|---|---|---|
hlsInterstitial | 
            
            shaka.extern.HLSInterstitial | 
configure(config)
    Called by the AdManager to provide an updated configuration any time it
changes.
    Parameters:
| Name | Type | Description | 
|---|---|---|
config | 
            
            shaka.extern.AdsConfiguration | 
cuepointsChanged_()
getCurrentInterstitial_(needPreRoll, numberToSkipopt) → {shaka.extern.AdInterstitial}
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
needPreRoll | 
            
            boolean | |||
numberToSkip | 
            
            number | 
                
                    <optional> | 
            
            
                0 | 
Returns:
getInterstitialsInfo_(hlsInterstitial) → {Promise.<!Array.<shaka.extern.AdInterstitial>>}
Parameters:
| Name | Type | Description | 
|---|---|---|
hlsInterstitial | 
            
            shaka.extern.HLSInterstitial | 
Returns:
- Type
 - Promise.<!Array.<shaka.extern.AdInterstitial>>
 
makeAdRequest_(url, contextopt) → {Promise.<BufferSource>}
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
url | 
            
            string | ||
context | 
            
            shaka.extern.RequestContext | 
                
                    <optional> | 
            
            
            
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 | 
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>}
 
Properties:
| Name | Type | Description | 
|---|---|---|
ASSETS | 
            
            
            Array.<shaka.ads.InterstitialAdManager.Asset> |