Interface: VideoAd

OO.Pulse. VideoAd

This interface is used to interact with individual linear video ads received from a OO.Pulse.Session.

You must notify this object of the following events:

Depending on your application some of the other methods may need to be called in response to user interaction.

Methods


adClickThroughTriggered()

Notify the session that the user has opened the clickthrough link.


adFailed(error)

Notify the session that, due to an error, the ad could not be played or that playback could not continue.

Parameters:
Name Type Description
error OO.PulseAdError

The OO.PulseAdError that best describes the problem.


adFinished()

Notify the session that the ad has played to completion.

After this, one of the following delegate methods may be triggered:


adPaused()

Notify the session that the ad has paused.


adPositionChanged(position)

Notify the session that the ad playback position has changed, either as a result of seeking or normal playback.

Parameters:
Name Type Description
position number

The ad position in seconds.


adResumed()

Notify the session that the ad has resumed playback.


adSkipped()

Notify the session that the ad was skipped/closed by the user.

After this, one of the following delegate methods may be triggered:


adStarted()

Notify the session that the ad has started playing.

Only call this method after your delegate has been instructed to play the ad through timeout).


getClickthroughURL()

Returns a URL pointing to a web page that should be displayed to the user when they click the ad.

Returns:

The URL to be opened.

Type
string

getCoreAd()

Returns the underlying low-level core Ad object. Advanced use only! In most cases, you do not need this.

Returns:

The underlying core Ad object.

Type
videoplaza.adresponse.Ad

getMediaFiles()

Returns an array of media files for this ad.

Your application should choose the best media file to display based on size, bandwidth, and format considerations.

If none of the media files are supported by your video player, you should call OO.Pulse.VideoAd#adFailed(error) with OO.PulseAdError.NO_SUPPORTED_MEDIA_FILE.

Returns:

An array containg the media files for the ad.

Type
Array.<videoplaza.adresponse.MediaFile>

getSkipOffset()

The amount of seconds from the start of the ad at which the button may first be displayed.

If an OOPulseVideoAd is playing, and a call to OO.Pulse.VideoAd#isSkippable returns true, show a skip button after this amount of seconds has passed.

Returns:

The amount of time in seconds which the ad must play for before a skip button can be shown, provided that OO.Pulse.VideoAd#isSkippable returns true.

Type
number

isSkippable()

Determine whether or not a skip button for the ad may be displayed.

If true, check the value of OO.Pulse.VideoAd#getSkipOffset, which is the amount of seconds from the start of the ad at which the button may first be displayed.

When the viewer activates this button, call OO.Pulse.VideoAd#adSkipped.

Returns:

Whether or not a skip button may be displayed after a given amount of time has passed.

Type
boolean

Type Definitions


defer()

Provided when LINEAR_AD_STARTING fires, used to prevent the ad from starting playback automatically.

Returns:

A function which, when called, starts playback for the ad.

Type
OO.Pulse.VideoAd~startPlayback

startPlayback()

Returned by OO.Pulse.VideoAd~defer, used to start playback for the previously deferred ad.