Interface: AdPlayerController

OO.Pulse. AdPlayerController

Pulse hybrid ad player controller, obtained when you call OO.Pulse.createAdPlayer. The ad player can play the following types of linear ads: VPAID 1, VPAID 2 and standard video ads.

Methods


adClickThroughOpened()

Call this method when a clickthrough URL is opened. It allows the SDK to track it.


addEventListener(event, callback)

Add an event listener to the player.

Parameters:
Name Type Description
event OO.Pulse.AdPlayer.Events

Event to listen to

callback

Callback function of type function(event,eventMetadata)


contentFinished()

Call this method when the content has finished.


contentPaused()

Call this method when the content is paused and is ready to show pause ads.


contentPositionChanged(position)

Notify the ad player about a playhead position update on the main content.

Parameters:
Name Type Description
position Number

Playhead position in seconds


contentStarted()

Call this method when the content has started / was resumed.


destroy()

Destroy the player. The session is destroyed, and the player's container freed.


getContainer()

Get the container element which was provided when the ad player was created.

Returns:

The container element.

Type
HTMLElement

getOverlayDiv()

Get the HTML overlay element of the ad player. This element can be directly controlled and styled so that it displays appropriately.

Returns:

The HTML overlay div the Pulse ad player uses

Type
HTMLElement

getSkinElement()

Get the HTML skin element of the ad player.

Returns:

The HTML skin div

Type
HTMLElement

getVolume()

Get the ad player's volume


isFlashAvailable()

Returns:

true if Flash is detected, false otherwise.

Type
boolean

mute()

Mute the ad player


overlayAdClosed()

Call this method when an overlay ad should be closed (i.e. a close button was pressed).


pause()

Pause the ad player.


pauseAdClosed()

Call this method when a pause ad should be closed (i.e. a close button was pressed). This does not need to be called if the content has resumed.


play()

Play/resume, valid for both ad and content playback.

Returns:

if play will result in an HTML5 video ad starting, the Promise from the <video> element being used is returned. Otherwise nothing.

Type
Promise | undefined

removeEventListener(event, callback)

Remove an event listener from the player.

Parameters:
Name Type Description
event OO.Pulse.AdPlayer.Events

Event to stop listening to

callback

Callback function to remove


resize(width, height, isFullScreen)

Resize the ad player. When using automatic scaling, the player applies 100% CSS rules to its container.

Parameters:
Name Type Description
width

width in pixels or OO.Pulse.AdPlayer.Settings.SCALING.AUTO for automatic scaling

height

height in pixels or OO.Pulse.AdPlayer.Settings.SCALING.AUTO for automatic scaling

isFullScreen Boolean

True when resizing to full screen


seek(timeSeconds)

Seek to a given position in the ad.

Parameters:
Name Type Description
timeSeconds Number

Position to seek to, in seconds


setVolume(volume)

Change the ad volume.

Parameters:
Name Type Description
volume Number

Volume between 0 and 1


skipButtonClicked()

If the skip button was clicked, inform the player so the ad can be skipped.


startSession(session, adPlayerListener)

Start a Pulse session. Call this method on the player's initial play. On mobile devices, this should be done during a user input (tap) callback so the ads can auto-play.

Parameters:
Name Type Description
session OO.Pulse.Session

Ad session

adPlayerListener OO.Pulse.AdPlayer.Listener

Ad player listener interface. The integration should implement this interface so the ad player can control the main content playback in order to display ads.


stopSession()

Stop a session. This method can be called at any time during the session. No more ads are displayed.


unmute()

Unmute the ad player