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
baseVideo_ :HTMLMediaElement
Type:
configurePlayer_ :function(!shaka.Player, ?shaka.extern.AdInterstitial)
Type:
- function(!shaka.Player, ?shaka.extern.AdInterstitial)
element_ :HTMLMediaElement
The media element of the asset, or null when it is played in the
primary video.
Type:
eventManager_ :shaka.util.EventManager
Listens to the media element and the player of the asset.
Type:
Methods
attach() → {Promise}
Attaches the player to the media element of the asset.
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 |
destroyAllPreloads()
Destroys the preloads made with the player of the asset.
getEventManager() → {shaka.util.EventManager}
Returns:
getMediaElement() → {HTMLMediaElement}
The media element the asset is played in.
Returns:
- Type
- HTMLMediaElement
getOwnElement() → {HTMLMediaElement}
The media element of the asset, if it is not played in the primary video.
Returns:
- Type
- HTMLMediaElement
getPlayer() → {shaka.Player}
The player of the asset, created the first time it is needed.
Returns:
- Type
- shaka.Player
mount()
Adds the media element of the asset to the container, if it is not
there yet.
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.
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.
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. |