Class: shaka.ads.InterstitialAd

Constructor

new InterstitialAd(video, interstitial, onSkip, sequenceLength, adPosition, isUsingAnotherMediaElement, rangeopt, nullable)

Parameters:
Name Type Attributes Default Description
video HTMLMediaElement
interstitial shaka.extern.AdInterstitial
onSkip function
sequenceLength number
adPosition number
isUsingAnotherMediaElement boolean
range Object <optional>
<nullable>
null The part of the media that is this ad, when the ad is not the whole media: its start and its end in the media, in seconds, or a null end if the ad runs to the end of the media. Embedded ads are the range of the content they describe. The type is written out because the constructor is part of the generated externs, which cannot name a private typedef.
Source:

Members

adPosition_ :number

Type:
  • number
Source:

isLinear_ :boolean

Type:
  • boolean
Source:

isSkippable_ :boolean

Type:
  • boolean
Source:

isUsingAnotherMediaElement_ :boolean

Type:
  • boolean
Source:

mediaReady_ :boolean

The media element is shared by every ad of a pod and is not unloaded between them, so until this ad's own media has loaded the element may still hold the previous ad. While that is the case the time based getters must not report the element's values.
Type:
  • boolean
Source:

onSkip_ :function()

Type:
  • function()
Source:

range_ :?{start: number, end: ?number}

Type:
  • ?{start: number, end: ?number}
Source:

sequenceLength_ :number

Type:
  • number
Source:

skipFor_ :number

Type:
  • number
Source:

skipOffset_ :number

Type:
  • number
Source:

Methods

canSkipNow()

Source:

getDuration()

Source:

getMediaUrl()

Source:

getPosition() → {number}

The playhead position within this ad.
Source:
Returns:
Type
number

getPositionInSequence()

Source:

getRemainingTime()

Source:

getSequenceLength()

Source:

getTimeOffset()

Source:

getTimeUntilSkippable()

Source:

hasCustomClick()

Source:

isClientRendering()

Source:

isLinear()

Source:

isSkippable()

Source:

isUsingAnotherMediaElement()

Source:

markMediaReady()

Called by the ad manager once the media element has loaded this ad's own media, after which the element's timings can be trusted.
Source: