Class: shaka.ads.MediaTailorAdManager

Constructor

new MediaTailorAdManager(adContainer, networkingEngine, video, onEvent)

Parameters:
Name Type Description
adContainer HTMLElement
networkingEngine shaka.net.NetworkingEngine
video HTMLMediaElement
onEvent function
Implements:
Source:

Members

BREAKEND_ :string

Type:
  • string
Source:

BREAKSTART_ :string

Type:
  • string
Source:

COMPLETE_ :string

Type:
  • string
Source:

FIRSTQUARTILE_ :string

Type:
  • string
Source:

IMPRESSION_ :string

Type:
  • string
Source:

MIDPOINT_ :string

Type:
  • string
Source:

MUTE_ :string

Type:
  • string
Source:

PAUSE_ :string

Type:
  • string
Source:

RESUME_ :string

Type:
  • string
Source:

SKIP_STATE_CHANGED_ :string

Type:
  • string
Source:

SKIPPED_ :string

Type:
  • string
Source:

START_ :string

Type:
  • string
Source:

THIRDQUARTILE_ :string

Type:
  • string
Source:

UNMUTE_ :string

Type:
  • string
Source:

adBreaks_ :Array.<!mediaTailor.AdBreak>

Type:
  • Array.<!mediaTailor.AdBreak>
Source:

adContainer_ :HTMLElement

Type:
  • HTMLElement
Source:

adListeners_ :Array.<{target: EventTarget, type: string, listener: shaka.util.EventManager.ListenerType}>

Type:
Source:

backupUrl_ :string

Type:
  • string
Source:

eventsSent :Array.<string>

Type:
  • Array.<string>
Source:

firstTrackingRequest_ :boolean

Type:
  • boolean
Source:

isLive_ :boolean

Type:
  • boolean
Source:

mediaTailorAd_ :mediaTailor.Ad

Type:
  • mediaTailor.Ad
Source:

mediaTailorAdBreak_ :mediaTailor.AdBreak

Type:
  • mediaTailor.AdBreak
Source:

onEvent_ :function(!shaka.util.FakeEvent)

Type:
  • function(!shaka.util.FakeEvent)
Source:

playedAds_ :Array.<string>

Type:
  • Array.<string>
Source:

snapForwardTime_ :number

Time to seek to after an ad if that ad was played as the result of snapback.
Type:
  • number
Source:

staticResources_ :Map.<string, !Array.<mediaTailorExternalResource.App>>

Type:
  • Map.<string, !Array.<mediaTailorExternalResource.App>>
Source:

streamRequestStartTime_ :number

Type:
  • number
Source:

trackingUrl_ :string

Type:
  • string
Source:

Methods

addTrackingUrl(url)

Parameters:
Name Type Description
url string
Source:

checkForSnapback_()

If a seek jumped over the ad break, return to the start of the ad break, then complete the seek after the ad played through.
Source:

checkLinearAds_(currentTime)

Parameters:
Name Type Description
currentTime number
Source:

checkNonLinearAds_(currentTime)

Parameters:
Name Type Description
currentTime number
Source:

displayNonLinearAd_(appsnon-null)

Parameters:
Name Type Description
apps Array.<mediaTailorExternalResource.App>
Source:

getCacheKeyForNonLinear_(nonLinearAd) → {string}

Parameters:
Name Type Description
nonLinearAd mediaTailor.NonLinearAd
Source:
Returns:
Type
string

getCuePoints() → {Array.<!shaka.extern.AdCuePoint>}

Source:
Returns:
Type
Array.<!shaka.extern.AdCuePoint>

onAdBreakEnded_()

Source:

onManifestUpdated(isLive)

Fired when the manifest is updated
Parameters:
Name Type Description
isLive boolean
Source:

onTimeupdate_()

Source:

release()

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

removeCurrentAdListeners_(skippedopt)

Parameters:
Name Type Attributes Default Description
skipped boolean <optional>
false
Source:

requestSessionInfo_(url, adsParams)

Parameters:
Name Type Description
url string
adsParams Object
Source:

requestStaticResource_(nonLinearAd)

Parameters:
Name Type Description
nonLinearAd mediaTailor.NonLinearAd
Source:

requestTrackingInfo_(trackingUrl, firstRequest)

Parameters:
Name Type Description
trackingUrl string
firstRequest boolean
Source:

sendInProgressEvents_(currentTime, ad)

Parameters:
Name Type Description
currentTime number
ad mediaTailor.Ad
Source:

sendTrackingEvent_(eventType)

Parameters:
Name Type Description
eventType string
Source:

setupAdBreakListeners_()

Setup Ad Break listeners
Source:

setupCurrentAdListeners_()

Source:

stop()

Resets the MediaTailor manager and removes any continuous polling.
Source:

streamRequest(url, adsParams, backupUrl) → {Promise.<string>}

Parameters:
Name Type Description
url string
adsParams Object
backupUrl string
Source:
Returns:
Type
Promise.<string>