Constructor
new AdManager(player)
Parameters:
- Implements:
- Source:
Members
clientSideAdContainer_ :HTMLElement
Type:
- Source:
locale_ :string
locale
Type:
- Source:
serverSideAdContainer_ :HTMLElement
Type:
- Source:
Methods
addAdUrlInterstitial(url) → {Promise}
Parameters:
| Name |
Type |
Description |
url |
string
|
|
- Implements:
- Source:
Returns:
-
Type
-
Promise
addCustomInterstitial(interstitial)
Parameters:
- Implements:
- Source:
Parameters:
| Name |
Type |
Description |
url |
string
|
|
- Implements:
- Source:
Called by the Player to provide an updated configuration any time it
changes.
Must be called at least once before init*().
Parameters:
- Implements:
- Source:
Get statistics for the current playback session. If the player is not
playing content, this will return an empty stats object.
- Implements:
- Source:
Returns:
-
Type
-
shaka.extern.AdsStats
initClientSide_(adsRenderingSettingsnullable)
Parameters:
| Name |
Type |
Attributes |
Description |
adsRenderingSettings |
google.ima.AdsRenderingSettings
|
<nullable>
|
|
- Source:
initInterstitial_()
- Source:
initServerSide_()
- Source:
Parameters:
- Implements:
- Source:
Parameters:
- Implements:
- Source:
Parameters:
- Implements:
- Source:
Returns:
-
Type
-
Promise
Parameters:
- Implements:
- Source:
onManifestUpdated(isLive)
Fired when the manifest is updated.
Parameters:
| Name |
Type |
Description |
isLive |
boolean
|
|
- Implements:
- Source:
processAndDispatchEvent_(eventnon-null)
Parameters:
- Source:
release()
Request that this object release all internal references.
- Implements:
- Source:
replaceServerSideAdTagParameters(adTagParameters)
Parameters:
| Name |
Type |
Description |
adTagParameters |
Object
|
|
- Implements:
- Source:
requestClientSideAds(imaRequestnon-null, adsRenderingSettingsnullable)
Parameters:
| Name |
Type |
Attributes |
Description |
imaRequest |
google.ima.AdsRequest
|
|
|
adsRenderingSettings |
google.ima.AdsRenderingSettings
|
<nullable>
|
|
- Implements:
- Source:
Parameters:
| Name |
Type |
Attributes |
Description |
url |
string
|
|
|
adsParams |
Object
|
|
|
backupUrl |
string
|
<optional>
|
|
- Implements:
- Source:
Returns:
-
Type
-
Promise<string>
requestServerSideStream(imaRequestnon-null, backupUrlopt) → {Promise<string>}
Parameters:
| Name |
Type |
Attributes |
Description |
imaRequest |
google.ima.dai.api.StreamRequest
|
|
|
backupUrl |
string
|
<optional>
|
|
- Implements:
- Source:
Returns:
-
Type
-
Promise<string>
setContainers(clientSideAdContainernon-null, serverSideAdContainernon-null)
Parameters:
| Name |
Type |
Description |
clientSideAdContainer |
HTMLElement
|
|
serverSideAdContainer |
HTMLElement
|
|
- Implements:
- Source:
setLocale(locale)
Parameters:
| Name |
Type |
Description |
locale |
string
|
|
- Implements:
- Source:
updateClientSideAdsRenderingSettings(adsRenderingSettingsnon-null)
Parameters:
| Name |
Type |
Description |
adsRenderingSettings |
google.ima.AdsRenderingSettings
|
|
- Implements:
- Source:
Events
AdBufferingEvent
Fired when the ad has stalled playback to buffer.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-buffering' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdClickedEvent
Fired when the ad was clicked.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-clicked' |
- Source:
AdClickEvent
Fired when the ad was clicked.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-clicked' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdClosedEvent
Fired when the ad was closed by the user.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-closed' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdCompleteEvent
Fired when an ad has played through.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-complete' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdContentPauseRequestedEvent
Fired when the ad requires the main content to be paused.
Fired when the platform does not support multiple media elements.
Properties:
| Name |
Type |
Attributes |
Description |
type |
string
|
|
'ad-content-pause-requested' |
saveLivePosition |
boolean
|
<nullable>
|
Indicates whether the live position has to be saved or not. |
- Source:
AdContentResumeRequestedEvent
Fired when the ad requires the main content to be resumed.
Fired when the platform does not support multiple media elements.
Properties:
| Name |
Type |
Attributes |
Description |
type |
string
|
|
'ad-content-resume-requested' |
offset |
number
|
<nullable>
|
Indicates the offset that should be applied to the previously saved time. |
- Source:
AdContentResumeRequestedEvent
Fired when the ad requires the video of the main content to be
attached.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-content-attach-requested' |
- Source:
AdCuePointsChangedEvent
Fired when the ad cue points change, signalling ad breaks
change.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-cue-points-changed' |
cuepoints |
Array<!shaka.extern.AdCuePoint>
|
The ad cue points, if available. |
- Source:
AdDurationChangedEvent
Fired when the ad's duration changes.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-duration-changed' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdFirstQuartileEvent
Fired when an ad has played through the first 1/4.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-first-quartile' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdImpressionEvent
Fired when the impression URL has been pinged.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-impression' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdInteractionEvent
Fired when an ad triggers the interaction callback.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-interaction' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdLinearChangedEvent
Fired when the displayed ad changes from
linear to nonlinear, or vice versa.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-linear-changed' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdLoadedEvent
Fired when the ad data becomes available.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-loaded' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
Fired when the ad's metadata becomes available.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-metadata' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdMidpointEvent
Fired when an ad has played through its midpoint.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-midpoint' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdMutedEvent
Fired when an ad was muted.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-muted' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdPausedEvent
Fired when an ad was paused.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-paused' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdPlayingEvent
Fired when an ad actually starts playback.
This event is triggered when the ad's media element enters the
'playing' state, indicating that the ad is truly rendering and
its playhead is advancing.
Unlike AdStartedEvent, which signals the intent to start an ad,
this event guarantees that playback has begun successfully.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-playing' |
ad |
shaka.extern.IAd
|
The ad that is now playing. |
- Source:
AdProgressEvent
Fired when there is an update to the current ad's progress.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-progress' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdRecoverableErrorEvent
Fired when the a non-fatal error was encountered.
The presentation will continue with the same or next ad playback
depending on the error situation.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-recoverable-error' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdResumedEvent
Fired when an ad was resumed after a pause.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-resumed' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdSkippedEvent
Fired when an ad has been skipped.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-skipped' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdSkipStateChangedEvent
Fired when an ad's skip state changes (for example, when
it becomes possible to skip the ad).
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-skip-state-changed' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdsLoadedEvent
Fired when a sequence of ads has been loaded.
Properties:
| Name |
Type |
Description |
type |
string
|
'ads-loaded' |
loadTime |
number
|
The time it takes to load ads. |
- Source:
AdStartedEvent
Fired when an ad has started playing.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-started' |
ad |
shaka.extern.IAd
|
The ad that has started playing. |
sdkAdObject |
Object
|
The ad object in the SDK format, if there is one. |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdStoppedEvent
Fired when an ad has stopped playing, was skipped,
or was unable to proceed due to an error.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-stopped' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdThirdQuartileEvent
Fired when an ad has played through the third quartile.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-third-quartile' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdVolumeChangedEvent
Fired when an ad's volume changed.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-volume-changed' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AllAdsCompletedEvent
Fired when the ads manager is done playing all the ads.
Properties:
| Name |
Type |
Description |
type |
string
|
'all-ads-completed' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdBreakEndedEvent
Fired when ad manager ends an ad break.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-break-ended' |
timeOffset |
number
|
The time offset for the ad break. |
- Source:
AdBreakReadyEvent
Fired when the client-side SDK is ready to play a
VPAID ad or an ad rule.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-break-ready' |
originalEvent |
Object
|
The native SDK event, if available. |
- Source:
AdBreakStartedEvent
Fired when ad manager starts an ad break.
Properties:
| Name |
Type |
Description |
type |
string
|
'ad-break-started' |
timeOffset |
number
|
The time offset for the ad break. |
startedAt |
number
|
Indicate at what position in the original content the break has started. |
- Source:
AdInterstitialPreloadedEvent
Fired when the ad manager finish the preload of an interstitial.
Properties:
- Source:
AdInterstitialPreloadEvent
Fired when the ad manager starts the preload of an interstitial.
Properties:
- Source:
ImaAdManagerLoadedEvent
Fired when the native IMA ad manager becomes available.
Properties:
| Name |
Type |
Description |
type |
string
|
'ima-ad-manager-loaded' |
imaAdManager |
Object
|
The native IMA ad manager. |
- Source:
ImaStreamManagerLoadedEvent
Fired when the native IMA stream manager becomes available.
Properties:
| Name |
Type |
Description |
type |
string
|
'ima-stream-manager-loaded' |
imaStreamManager |
Object
|
The native IMA stream manager. |
- Source: