Class: shaka.ads.InterstitialMediaAsset

Constructor

new InterstitialMediaAsset(basePlayernon-null, container, configurePlayer)

Parameters:
Name Type Description
basePlayer shaka.Player The player of the primary content.
container HTMLElement The element the asset is drawn in.
configurePlayer function Configures the player of an interstitial.
Implements:
Source:

Members

configurePlayer_ :function(!shaka.Player, ?shaka.extern.AdInterstitial)

Type:
  • function(!shaka.Player, ?shaka.extern.AdInterstitial)
Source:

container_ :HTMLElement

Type:
  • HTMLElement
Source:

element_ :HTMLMediaElement

The media element of the asset, or null when it is played in the primary video.
Type:
Source:

eventManager_ :shaka.util.EventManager

Listens to the media element and the player of the asset.
Type:
Source:

released_ :boolean

Type:
  • boolean
Source:

Methods

attach() → {Promise}

Attaches the player to the media element of the asset.
Source:
Returns:
Type
Promise

configure(interstitialopt, nullable)

Configures the player like the player of the primary content, and then for the interstitial.
Parameters:
Name Type Attributes Default Description
interstitial shaka.extern.AdInterstitial <optional>
<nullable>
null
Source:

createElement_() → {HTMLMediaElement}

Source:
Returns:
Type
HTMLMediaElement

destroyAllPreloads()

Destroys the preloads made with the player of the asset.
Source:

getMediaElement() → {HTMLMediaElement}

The media element the asset is played in.
Source:
Returns:
Type
HTMLMediaElement

getOwnElement() → {HTMLMediaElement}

The media element of the asset, if it is not played in the primary video.
Source:
Returns:
Type
HTMLMediaElement

getPlayer() → {shaka.Player}

The player of the asset, created the first time it is needed.
Source:
Returns:
Type
shaka.Player

hide()

Hides the media element of the asset.
Source:

mount()

Adds the media element of the asset to the container, if it is not there yet.
Source:

release()

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

reset()

Stops the asset and forgets its media element, which the owner of the container removes.
Source:

show()

Shows the media element of the asset.
Source:

stop() → {Promise}

Stops playing the asset: the player leaves the primary video, which the primary content plays in again, and unloads a media element of its own, which is kept for the next asset.
Source:
Returns:
Type
Promise

useOwnElement(ownElement, recreateopt)

Chooses whether the asset is played in a media element of its own, or in the primary video.
Parameters:
Name Type Attributes Default Description
ownElement boolean
recreate boolean <optional>
false If true, replaces the media element of the asset with a new one.
Source: