Class: shaka.ads.InterstitialAdSession

Constructor

new InterstitialAdSession(videonon-null, interstitialnon-null, adnon-null, onEvent, contentPosition)

Parameters:
Name Type Description
video HTMLMediaElement
interstitial shaka.extern.AdInterstitial
ad shaka.ads.InterstitialAd
onEvent function
contentPosition function
Implements:
Source:

Interfaces

Tracker

Members

canSkip_ :boolean

Type:
  • boolean
Source:

completed_ :boolean

Type:
  • boolean
Source:

contentPosition_ :function(): number

Type:
  • function(): number
Source:

lastPosition_ :number

Type:
  • number
Source:

muted_ :boolean

Type:
  • boolean
Source:

onEvent_ :function(string)

Type:
  • function(string)
Source:

paused_ :boolean

Type:
  • boolean
Source:

playedRanges_ :Array<{start: number, end: number}>

Type:
  • Array<{start: number, end: number}>
Source:

quartiles_ :Set<string>

Type:
  • Set<string>
Source:

released_ :boolean

Type:
  • boolean
Source:

seeked_ :boolean

Type:
  • boolean
Source:

started_ :boolean

Type:
  • boolean
Source:

Methods

canComplete() → {boolean}

Source:
Returns:
Type
boolean

expandUri(uri) → {string}

Expands known VAST macros and uses the VAST unavailable value for context the player cannot supply. Apps may still add context via request filters.
Parameters:
Name Type Description
uri string
Source:
Returns:
Type
string

getPosition() → {number}

The playhead position relative to the start of the interstitial.
Source:
Returns:
Type
number

hasSeeked() → {boolean}

Whether the user seeked during the interstitial. Browsers fire timeupdate before seeked, so the seeked event alone is not enough to tell a skip from the natural end of the interstitial.
Source:
Returns:
Type
boolean

notify(type)

Forwards an ad event to the tracker. Events describing playback are only forwarded once playback has actually started.
Parameters:
Name Type Description
type string
Source:

refresh()

Delivers data that became valid while it was being resolved, without replaying events that were already delivered.
Source:

release()

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

setTracker(trackernullable)

Attaches the format specific tracker, if any, and resolves its deferred data. Data that becomes available later is delivered without replaying events that were already sent.
Parameters:
Name Type Attributes Description
tracker shaka.ads.InterstitialAdSession.Tracker <nullable>
Source:

update()

Advances measurement only over media played at normal speed. Quartiles and offset events crossed by seeks or fast playback are not backfilled.
Source:

Type Definitions

TrackerFactory

Creates the tracker of an interstitial, or null if it has nothing to track. It is given a function that sends a tracking beacon, expanding its macros, and a function that fetches a resource.
Type:
  • function(!shaka.extern.AdInterstitial, !shaka.ads.InterstitialAdSession, function(string), function(string): !shaka.net.NetworkingEngine.PendingRequest): ?shaka.ads.InterstitialAdSession.Tracker
Source: