top

AdFramework API

To use Samsung Product API, 

<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>

Should be loaded in index.html

The AdFramework module allows playback of video content with ads via the IAB VAST/VMAP standards.

Since : 1.0

Table of Contents

  1. 1. Type Definitions
    1. 1.1. AdFrameworkPlaybackType
    2. 1.2. AdFrameworkDisplayRect
    3. 1.3. AdFrameworkInitializationObject
    4. 1.4. AdFrameworkEvent
    5. 1.5. AdFrameworkPlayerAdapterEvent
  2. 2. Interfaces
    1. 2.1. AdFrameworkBeforeLinearAdStartCallback
    2. 2.2. AdFrameworkAfterLinearAdStartCallback
    3. 2.3. AdFrameworkBeforeLinearContentStartCallback
    4. 2.4. AdFrameworkAfterLinearContentStartCallback
    5. 2.5. AdFrameworkLinearAdUrlCallback
    6. 2.6. AdFrameworkTrackingUrlCallback
    7. 2.7. AdFrameworkErrorUrlModifierCallback
    8. 2.8. AdFrameworkCompanionAdCallback
    9. 2.9. AdFrameworkEventCallback
    10. 2.10. AdFrameworkManagerObject
    11. 2.11. AdFrameworkManager
    12. 2.12. AdFrameworkController
    13. 2.13. AdFrameworkEvents
    14. 2.14. AdFrameworkPlayerAdapter
    15. 2.15. AdFrameworkConfig
    16. 2.16. AdFrameworkVisualOverlay
  3. 3. Full WebIDL

Summary of Interfaces and Methods

Interface Method
AdFrameworkBeforeLinearAdStartCallback void onbeforelinearadstart(object player)
AdFrameworkAfterLinearAdStartCallback void onafterlinearadstart(object player)
AdFrameworkBeforeLinearContentStartCallback void onbeforecontentstart(object player)
AdFrameworkAfterLinearContentStartCallback void onaftercontentstart(object player)
AdFrameworkLinearAdUrlCallback void onlinearadurl(DOMString url)
AdFrameworkTrackingUrlCallback void ontrackingurl(DOMString url)
AdFrameworkErrorUrlModifierCallback void onerrorurl(DOMString url)
AdFrameworkCompanionAdCallback void oncompanionad(object ad)
AdFrameworkEventCallback void onevent(AdFrameworkPlayerAdapterEvent event, object params)
AdFrameworkManagerObject  
AdFrameworkManager  
AdFrameworkController void initialize(optional AdFrameworkInitializationObject params)
void open(DOMString contentUrl, DOMString vmapUrl)
void startPlayback(optional long playhead)
void setBeforeContentStartHandler(AdFrameworkBeforeLinearContentStartCallback onbeforecontentstart)
void setBeforeLinearAdStartHandler(AdFrameworkBeforeLinearAdStartCallback onbeforelinearadstart)
void setAfterContentStartHandler(AdFrameworkAfterLinearContentStartCallback onaftercontentstart)
void setAfterLinearAdStartHandler(AdFrameworkAfterLinearAdStartCallback onafterlinearadstart)
void changeContentUrl(DOMString contentUrl)
void setLinearAdUrlModifier(AdFrameworkLinearAdUrlCallback onlinearadurl)
void setTrackingUrlModifier(AdFrameworkTrackingUrlCallback ontrackingurl)
void setErrorUrlModifier(AdFrameworkErrorUrlModifierCallback onerrorurl)
void insertAdBreak(DOMString xmlUrl, object params)
void playAdImmediately(DOMString xmlUrl)
void bufferStandaloneAd(DOMString xmlUrl)
void playBufferedStandaloneAd()
AdFrameworkPlaybackType getCurrentPlaybackType()
void stop()
void pause()
void resume()
void jumpForward(long second)
void jumpBackward(long second)
void signalTrickPlayStart()
void signalTrickPlayStop()
void signalMuted()
void signalUnmuted()
long getDuration()
void setDisplayRect(AdFrameworkDisplayRect displayRect)
AdFrameworkDisplayRect getDisplayRect()
long getPlayhead()
long getContentPlayhead()
void setContentPlayhead(long milliseconds)
void offsetContentPlayhead(long milliseconds)
long getAdPlayhead()
long[] getAdBreakTimes()
boolean isPlayingLinearAd()
void disableAdInsertion()
void enableAdInsertion()
AdFrameworkPlayerAdapter getPlayer()
void setCompanionAdHandler(AdFrameworkCompanionAdCallback oncompanionad)
DOMString getVersion()
AdFrameworkEvents void addListener(AdFrameworkEvent eventName, AdFrameworkEventCallback handler, optional boolean removeOnExecute)
void removeListener(AdFrameworkEvent eventName, Callback handler)
AdFrameworkPlayerAdapter void addListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback, optional boolean removeOnExecute)
void removeListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback)
AdFrameworkConfig void set(DOMString attributeName, any configurationValue)
any get(DOMString attributeName)
AdFrameworkVisualOverlay void simulateVideoClick()
void simulateNonLinearClick()
void setIFrameSandboxParameters(DOMString sandboxParameters)

1. Type Definitions

1.1. AdFrameworkPlaybackType

This enumeration describe the possible playback states of AdFramework

enum AdFrameworkPlaybackType { "STOPPED", "CONTENT", "LINEAR_AD" , "INTERACTIVE_AD"};

Since : 1.0

The following values are supported

  • STOPPED - Playback is stopped.
  • CONTENT - Content playback is occurring.
  • LINEAR_AD - Ad playback is occurring.
  • INTERACTIVE_AD - Interactive ad playback is occurring.

1.2. AdFrameworkDisplayRect

This dictionary type defines the object that can be passed into setDisplayRect()

dictionary AdFrameworkDisplayRect {
    long x;
    long y;
    long w;
    long h;
};

Since : 1.0

The following values are supported

  • x - This is the X position of the displayRect.
  • y - This is the Y position of the displayRect.
  • w - This is the width of the displayRect.
  • h - This is the height of the displayRect.

1.3. AdFrameworkInitializationObject


dictionary AdFrameworkInitializationObject {
    DOMString playerID1;
    DOMString playerID2;
    DOMString adapterType;
};

Since : 1.0

The following values are supported

  • playerID1 - ID of the first player. Should not be used unless choosing a HTML5 adapter
  • playerID2 - ID of the second player. Should not be used unless choosing a HTML5 adapter.
  • adapterType - Type of the adapter. Set to "HTML5" to use HTML5 player. Leave blank to let the Ad Framework decide (it will choose AVPlay on Tizen)

1.4. AdFrameworkEvent

This enumeration describes the possible events that could be dispatched by AdFramework.

enum AdFrameworkEvent {
    "PLAYBACK_TIME",
    "AD_PLAYBACK_TIME",
    "CONTENT_PLAYBACK_TIME",
    "ADBREAK_INSERTION_SUCCESS",
    "ADBREAK_INSERTION_FAILURE",
    "PLAYBACK_COMPLETE",
    "LINEAR_AD_PREBUFFER_START",
    "LINEAR_AD_START",
    "LINEAR_AD_END",
    "LINEAR_AD_COMPLETE",
    "NONLINEAR_AD_START",
    "NONLINEAR_AD_END",
    "ADBREAK_START",
    "ADBREAK_END",
    "CONTENT_PREBUFFER_START",
    "CONTENT_SUSPEND",
    "CONTENT_START",
    "IFRAME_OPEN",
    "IFRAME_CLOSE",
    "TRACKING_EVENT",
    "ERROR_TRACKER",
    "COMPANION_ADS_CREATIVE_DETECTED",
    "COMPANION_AD_FAILED_REQUIRED_ALL",
    "COMPANION_AD_FAILED_REQUIRED_ANY",
    "COMPANION_AD_START",
    "VPAID_COMPLETE",
    "VPAID_LINEARITY_CHANGE",
    "VPAID_ERROR",
    "VPAID_LINEAR_PLAYBACK_TIME",
    "PARSING_ERROR",
    "UNRECOVERABLE_PLAYBACK_ERROR",
    "RECOVERABLE_PLAYBACK_ERROR",
    "VSUITE_PLAYBACK_ERROR",
    "PLAYBACK_TYPE",
    "DEBUG_MESSAGE"
};

Since : 1.0

The following values are supported

  • PLAYBACK_TIME - Playback time event from the currently playing video.
  • AD_PLAYBACK_TIME - Playback time event from the currently playing ad.
  • CONTENT_PLAYBACK_TIME - Playback time event from the currently playing content.
  • ADBREAK_INSERTION_SUCCESS - Adbreak inserted successfully
  • ADBREAK_INSERTION_FAILURE - Failed to insert adbreak
  • PLAYBACK_COMPLETE - Content and ad playback schedule has been finished. Nothing left to play.
  • LINEAR_AD_PREBUFFER_START - Linear ad is prebuffering.
  • LINEAR_AD_START - Linear ad has begun playback.
  • LINEAR_AD_END - Linear ad playback has ended.
  • LINEAR_AD_COMPLETE - Linear ad playback has run through to completion (end of the ad)
  • NONLINEAR_AD_START - A nonlinear ad has been triggered and is displaying on-screen.
  • NONLINEAR_AD_END - A nonlinear ad has ended and is no longer being displayed.
  • ADBREAK_START - An adbreak is starting.
  • ADBREAK_END - An adbreak has ended.
  • CONTENT_PREBUFFER_START - Content video is prebuffering.
  • CONTENT_SUSPEND - Content needs to suspend to allow for scheduled ad playback.
  • CONTENT_START - Content video is starting to play.
  • IFRAME_OPEN - An ad iframe has opened.
  • IFRAME_CLOSE - An ad iframe has closed.
  • TRACKING_EVENT - An ad tracking event has fired.
  • ERROR_TRACKER - An ad error tracker has fired.
  • COMPANION_ADS_CREATIVE_DETECTED - A companion ad creative has been detected. Action on the app's part may be required.
  • COMPANION_AD_FAILED_REQUIRED_ALL - An ad has failed to play due to not being able to display all required companion ads.
  • COMPANION_AD_FAILED_REQUIRED_ANY - An ad has failed to play due to not being able to display a required companion ad.
  • COMPANION_AD_START - A companion ad has been triggered.
  • VPAID_COMPLETE - A VPAID ad has finished.
  • VPAID_LINEARITY_CHANGE - A VPAID ad has changed toggled linearity - it may either be linear or nonlinear.
  • VPAID_ERROR - A VPAID ad has encountered an error.
  • VPAID_LINEAR_PLAYBACK_TIME - A linear VPAID ad has updated its playback time.
  • PARSING_ERROR - General VAST/VMAP parsing error encountered.
  • UNRECOVERABLE_PLAYBACK_ERROR - Video playback has failed, action is required because ad framework is not going to attempt recovery.
  • RECOVERABLE_PLAYBACK_ERROR - Video playback has failed, but no action is required as the ad framework is about to attempt recovery and restart the video.
  • VSUITE_PLAYBACK_ERROR - A V-Suite ad playback error event has been triggered.
  • PLAYBACK_TYPE - Playback type has changed. Playback type may be one of "CONTENT", "LINEAR_AD", "INTERACTIVE_AD", or "STOPPED".
  • DEBUG_MESSAGE - A general logging/debugging message dispatched by ad framework.

1.5. AdFrameworkPlayerAdapterEvent

This enumeration describe the possible event types of AdFramework

enum AdFrameworkPlayerAdapterEvent {
    "CURRENT_PLAYBACK_TIME",
    "SUBTITLE",
    "CUSTOM",
    "SPARSE_TRACK",
    "RENDER_ERROR",
    "PLAYER_EXCEPTION",
    "STREAM_INFO_READY",
    "STREAM_STOPPED",
    "RENDERING_START",
    "RENDERING_COMPLETE",
    "BUFFERING_START",
    "BUFFERING_PROGRESS",
    "BUFFERING_COMPLETE",
    "RESOLUTION_CHANGED",
    "BITRATE_CHANGED",
    "AD_START",
    "AD_END",
    "DECODING_COMPLETE",
    "CONNECTION_FAILED",
    "AUTHENTICATION_FAILED",
    "STREAM_NOT_FOUND",
    "NETWORK_DISCONNECTED",
    "NETWORK_SLOW",
    "PREBUFFERING_CURRENT_PLAYBACK_TIME",
    "PREBUFFERING_BUFFERING_PROGRESS",
    "PREBUFFERING_SUBTITLE",
    "PREBUFFERING_CUSTOM",
    "PREBUFFERING_SPARSE_TRACK",
    "PREBUFFERING_RENDER_ERROR",
    "PREBUFFERING_STREAM_INFO_READY",
    "PREBUFFERING_RENDERING_START",
    "PREBUFFERING_RENDERING_COMPLETE",
    "PREBUFFERING_BUFFERING_START",
    "PREBUFFERING_BUFFERING_COMPLETE",
    "PREBUFFERING_RESOLUTION_CHANGED",
    "PREBUFFERING_BITRATE_CHANGED",
    "PREBUFFERING_AD_START",
    "PREBUFFERING_AD_END",
    "PREBUFFERING_DECODING_COMPLETE",
    "PREBUFFERING_CONNECTION_FAILED",
    "PREBUFFERING_AUTHENTICATION_FAILED",
    "PREBUFFERING_STREAM_NOT_FOUND",
    "PREBUFFERING_NETWORK_DISCONNECTED",
    "PREBUFFERING_NETWORK_SLOW"
};

Since : 1.0

The following values are supported

  • CURRENT_PLAYBACK_TIME - Current playback time event from the video.
  • SUBTITLE - Video subtitle event
  • CUSTOM - This event is reserved for future use, but is currently useless.
  • SPARSE_TRACK - A sparse track has been detected from the video stream.
  • RENDER_ERROR - A render error has been detected from the video stream.
  • PLAYER_EXCEPTION - The video player's API threw an unexpected exception.
  • STREAM_INFO_READY - The video stream's general information is ready.
  • STREAM_STOPPED - The video stream has stopped for an unknown reason.
  • RENDERING_START - Video rendering has started.
  • RENDERING_COMPLETE - Video rendering has completed.
  • BUFFERING_START - Video buffering has started.
  • BUFFERING_PROGRESS - Video buffering has progressed.
  • BUFFERING_COMPLETE - Video buffering has completed.
  • RESOLUTION_CHANGED - Video player resolution has changed.
  • BITRATE_CHANGED - Video bitrate has changed.
  • AD_START - This event is reserved for future use, but is currently useless.
  • AD_END - This event is reserved for future use, but is currently useless.
  • DECODING_COMPLETE - Video player decoding has completed.
  • CONNECTION_FAILED - Video playback has failed due to a connection error.
  • AUTHENTICATION_FAILED - Video playback has failed due to an auth error.
  • STREAM_NOT_FOUND - Video playback has failed due to not being able to locate the specified stream.
  • NETWORK_DISCONNECTED - Video playback has failed due to a network error.
  • NETWORK_SLOW - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_CURRENT_PLAYBACK_TIME - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_BUFFERING_PROGRESS - The video being prebuffered has made progress buffering.
  • PREBUFFERING_SUBTITLE - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_CUSTOM - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_SPARSE_TRACK - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_RENDER_ERROR - A render error has been detected on the video stream being prebuffered.
  • PREBUFFERING_STREAM_INFO_READY - The prebuffered video's stream information is available.
  • PREBUFFERING_RENDERING_START - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_RENDERING_COMPLETE - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_BUFFERING_START - The video being prebuffered has started buffering.
  • PREBUFFERING_BUFFERING_COMPLETE - The video being prebuffered has finished buffering.
  • PREBUFFERING_RESOLUTION_CHANGED - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_BITRATE_CHANGED - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_AD_START - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_AD_END - This event is reserved for future use, but is currently useless.
  • PREBUFFERING_DECODING_COMPLETE - Video player decoding has completed.
  • PREBUFFERING_CONNECTION_FAILED - Video playback has failed due to a connection error.
  • PREBUFFERING_AUTHENTICATION_FAILED - Video playback has failed due to an auth error.
  • PREBUFFERING_STREAM_NOT_FOUND - Video playback has failed due to not being able to locate the specified stream.
  • PREBUFFERING_NETWORK_DISCONNECTED - Video playback has failed due to a network error.
  • PREBUFFERING_NETWORK_SLOW - This event is reserved for future use, but is currently useless.

2. Interfaces

2.1. AdFrameworkBeforeLinearAdStartCallback

This callback function is desgined to handle the state of linear ad playback

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkBeforeLinearAdStartCallback {
    void onbeforelinearadstart(object player);
};

Since : 1.0

2.2. AdFrameworkAfterLinearAdStartCallback

This callback function is desgined to handle the state of linear ad playback

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkAfterLinearAdStartCallback {
    void onafterlinearadstart(object player);
};

Since : 1.0

2.3. AdFrameworkBeforeLinearContentStartCallback

This callback function is desgined to handle the state of content playback

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkBeforeLinearContentStartCallback {
    void onbeforecontentstart(object player);
};

Since : 1.0

2.4. AdFrameworkAfterLinearContentStartCallback

This callback function is desgined to handle the state of content playback

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkAfterLinearContentStartCallback {
    void onaftercontentstart(object player);
};

Since : 1.0

2.5. AdFrameworkLinearAdUrlCallback

This callback function is designed to handle linear ad URLs

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkLinearAdUrlCallback {
    void onlinearadurl(DOMString url);
};

Since : 1.0

2.6. AdFrameworkTrackingUrlCallback

This callback function is designed to handle tracking URLs

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkTrackingUrlCallback {
    void ontrackingurl(DOMString url);
};

Since : 1.0

2.7. AdFrameworkErrorUrlModifierCallback

This callback function is designed to handle error tracking URLs

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkErrorUrlModifierCallback {
    void onerrorurl(DOMString url);
};

Since : 1.0

2.8. AdFrameworkCompanionAdCallback

This callback function is designed to handle companion ads

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkCompanionAdCallback {
    void oncompanionad(object ad);
};

Since : 1.0

2.9. AdFrameworkTrackingUrlCallback

This callback function is designed to handle events.

[Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkEventCallback {
    void onevent(AdFrameworkPlayerAdapterEvent event, object params);
};

Since : 1.0

2.10. AdFrameworkManagerObject

The AdFrameworkManagerObject interface defines what is instantiated by the Webapis object from the Tizen Platform.

[NoInterfaceObject] interface AdFrameworkManagerObject {
        readonly attribute AdFrameworkManager adframework;
};

  WebApi implements AdFrameworkManagerObject;

Since : 1.0

Attributes

  • readonly AdFrameworkManager adframework
    This attribute of AdFrameworkManagerObject contains an instance of adframework which is instantiated by the Webapis object from the Tizen Platform.for developer will interact with.

    Since : 1.0

2.11. AdFrameworkManager

The AdFramework allows playback of video content with ads via the IAB VAST/VMAP standards.

[NoInterfaceObject] interface AdFrameworkManager {
    readonly attribute AdFrameworkVisualOverlay visualoverlay;
    readonly attribute AdFrameworkController controller;
    readonly attribute AdFrameworkEvents events;
    readonly attribute AdFrameworkConfig config;
};

Since : 1.0

Attributes

  • readonly AdFrameworkVisualOverlay visualoverlay
    The VisualOverlay class of AdFramework allows the developer to control various aspects of the Ad UI.

    Since : 1.0

  • readonly AdFrameworkController controller
    This attribute of AdFramework allows the developer to control playback of content/ads. It is the main class that the developer will interact with.

    Since : 1.0

  • readonly AdFrameworkEvents events
    The Events interface of AdFramework allows the developer to listen to various events related to AdFramework and its playback of content and ad video.

    Since : 1.0

  • readonly AdFrameworkConfig config
    The Config class of AdFramework allows the developer to customize the behavior of AdFramework.

    Since : 1.0

2.12. AdFrameworkController

This attribute of AdFramework allows the developer to control playback of content/ads. It is the main class that the developer will interact with.

[NoInterfaceObject] interface AdFrameworkController {
        void initialize(optional AdFrameworkInitializationObject params);
        void open(DOMString contentUrl, DOMString vmapUrl);
        void startPlayback(optional long playhead) ;
        void setBeforeContentStartHandler(AdFrameworkBeforeLinearContentStartCallback onbeforecontentstart) ;
        void setBeforeLinearAdStartHandler(AdFrameworkBeforeLinearAdStartCallback onbeforelinearadstart) ;
        void setAfterContentStartHandler(AdFrameworkAfterLinearContentStartCallback onaftercontentstart) ;
        void setAfterLinearAdStartHandler(AdFrameworkAfterLinearAdStartCallback onafterlinearadstart) ;
        void changeContentUrl(DOMString contentUrl) ;
        void setLinearAdUrlModifier(AdFrameworkLinearAdUrlCallback onlinearadurl) ;
        void setTrackingUrlModifier(AdFrameworkTrackingUrlCallback ontrackingurl) ;
        void setErrorUrlModifier(AdFrameworkErrorUrlModifierCallback onerrorurl) ;
        void insertAdBreak(DOMString xmlUrl, object params) ;
        void playAdImmediately(DOMString xmlUrl) ;
        void bufferStandaloneAd(DOMString xmlUrl) ;
        void playBufferedStandaloneAd() ;
        AdFrameworkPlaybackType getCurrentPlaybackType() ;
        void stop() ;
        void pause() ;
        void resume() ;
        void jumpForward(long second) ;
        void jumpBackward(long second) ;
        void signalTrickPlayStart() ;
        void signalTrickPlayStop() ;
        void signalMuted() ;
        void signalUnmuted() ;
        long getDuration() ;
        void setDisplayRect(AdFrameworkDisplayRect displayRect) ;
        AdFrameworkDisplayRect getDisplayRect() ;
        long getPlayhead() ;
        long getContentPlayhead() ;
        void setContentPlayhead(long milliseconds) ;
        void offsetContentPlayhead(long milliseconds) ;
        long getAdPlayhead() ;
        long[] getAdBreakTimes() ;
        boolean isPlayingLinearAd() ;
        void disableAdInsertion() ;
        void enableAdInsertion() ;
        AdFrameworkPlayerAdapter getPlayer() ;
        void setCompanionAdHandler(AdFrameworkCompanionAdCallback oncompanionad) ;
        DOMString getVersion();
};

Since : 1.0

Methods

initialize
This initializes the ad framework so that it is ready to play content/ads. There are possible parameters provided to modify the behavior.

void initialize(optional AdFrameworkInitializationObject params);

Since : 1.0

Parameters:

  • Params [OPTIONAL]: Object(playerID1, playerID2, adapterType)
    playerID1: ID of the first player
    playerID2: ID of the second player
    adapterType: Type of the adapter

Code example:


webapis.adframework.controller.initialize()
open
Provide Urls to content video and advertisement XML.

void open(DOMString contentUrl, DOMString vmapUrl);

Since : 1.0

Parameters:

  • contentUrl: Url to content video
  • vmapUrl [OPTIONAL]: Url to VAST/VMAP XML

Code example:


var contentUrl = "http://192.168.1.16/bunny.mp4"
var vmapUrl = "http://192.168.1.16/vmap.xml"
webapis.adframework.controller.open(contentUrl, vmapUrl)
startPlayback
Begins playback with initialized content Url and VMAP Url

void startPlayback(optional long playhead) ;

Since : 1.0

Parameters:

  • playhead [OPTIONAL]: Milliseconds

Code example:


webapis.adframework.controller.startPlayback(5000)
setBeforeContentStartHandler
Specifies a function to execute each time before the content video starts

void setBeforeContentStartHandler(AdFrameworkBeforeLinearContentStartCallback onbeforecontentstart) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setBeforeContentStartHandler(function(player) {
player.setStreamingProperty("SET_MODE_4K", "TRUE"); 
})
setBeforeLinearAdStartHandler
Specifies a function to execute each time after a linear ad starts

void setBeforeLinearAdStartHandler(AdFrameworkBeforeLinearAdStartCallback onbeforelinearadstart) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setBeforeLinearAdStartHandler(function(player) {
 player.setStreamingProperty("SET_MODE_4K", "TRUE"); 
})
setAfterContentStartHandler
Specifies a function to execute each time before the content video starts

void setAfterContentStartHandler(AdFrameworkAfterLinearContentStartCallback onaftercontentstart) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setAfterContentStartHandler(function(player) {
 player.setStreamingProperty("SET_MODE_4K", "TRUE"); 
})
setAfterLinearAdStartHandler
Specifies a function to execute each time before a linear ad starts

void setAfterLinearAdStartHandler(AdFrameworkAfterLinearAdStartCallback onafterlinearadstart) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setAfterLinearAdStartHandler(function(player) {
 player.setStreamingProperty("SET_MODE_4K", "TRUE"); 
})
changeContentUrl
Specifies a new Content Url. This Url will be used after resuming from a linear ad break.

void changeContentUrl(DOMString contentUrl) ;

Since : 1.0

Parameters:

  • url: New content Url

Code example:


var url = "http://192.168.1.16/bunny.mp4?token=8rq3gr78g"
webapis.adframework.controller.changeContentUrl(url)
setLinearAdUrlModifier
Specifies a function to execute each time before a linear ad starts. The return value of this function will change the linear ad's Url.

void setLinearAdUrlModifier(AdFrameworkLinearAdUrlCallback onlinearadurl) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setLinearAdUrlModifier(function(string) {
 string += "?token=n738th3t";
 return string;
});
setTrackingUrlModifier
Specifies a function to execute each time before a tracking Url fires. The return value of this function will change the tracker's Url only for non-error trackers.

void setTrackingUrlModifier(AdFrameworkTrackingUrlCallback ontrackingurl) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setTrackingUrlModifier(function(string) {
 string += "?guid=SD38264F";
 return string;
});
setErrorUrlModifier
Specifies a function to execute each time before a error Url fires. The return value of this function will change the tracker's Url only for error trackers.

void setErrorUrlModifier(AdFrameworkErrorUrlModifierCallback onerrorurl) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setErrorUrlModifier(function(string) {
 string += "?guid=SD38264F&error=BAD_CODEC";
 return string;
});
insertAdBreak
Given an XML file and an Object, inserts an ad break using the XML and properties inside the Object.

void insertAdBreak(DOMString xmlUrl, object params) ;

Since : 1.0

Parameters:

  • xmlUrl: Url to VAST/VMAP XML
  • params [OPTIONAL]: Configuration of the ad break (can insert a custom time for ad break to start)

Code example:


var vmapUrl = "http://192.168.1.16/vmap.xml"
webapis.adframework.controller.insertAdBreak(vmapUrl, {time: 5000})
playAdImmediately
Given an XML file and an Object, inserts an ad break using the XML and properties inside the Object, and plays the ad immediately (stopping any playing video)

It is a feature only implemented because of tile ads. This allows ads to be played without any content video.

This API is the equivalent of calling both bufferStandaloneAd() and playBufferedStandaloneAd().

void playAdImmediately(DOMString xmlUrl) ;

Since : 1.0

Parameters:

  • vmapUrl: Url to VAST/VMAP XML

Code example:


var vmapUrl = "http://192.168.1.16/vmap.xml"
webapis.adframework.controller.playAdImmediately(vmapUrl)
bufferStandaloneAd
You can call this function to play ads without any content. This function will prepare a standalone ad for playback.

It is a feature only implemented because of tile ads. This allows ads to be played without any content video.

void bufferStandaloneAd(DOMString xmlUrl) ;

Since : 1.0

Parameters:

  • vmapUrl: Url to VAST/VMAP XML

Code example:


var vmapUrl = "http://192.168.1.16/vmap.xml"
webapis.adframework.controller.bufferStandaloneAd(vmapUrl)
playBufferedStandaloneAd
You can call this function to play ads without any content. This function will play a standalone ad that was buffered by bufferStandaloneAd().

It is a feature only implemented because of tile ads. This allows ads to be played without any content video.

void playBufferedStandaloneAd() ;

Since : 1.0

Code example:


webapis.adframework.controller.playBufferedStandaloneAd()
getCurrentPlaybackType
Returns the current playback type (as a string). The playback type may be one of:

STOPPED, LINEAR_AD, CONTENT, INTERACTIVE_AD (please see the WIDL for more information)

AdFrameworkPlaybackType getCurrentPlaybackType() ;

Since : 1.0

Return value:

DOMString Playback type (see the related enum)

Code example:


var type = webapis.adframework.controller.getCurrentPlaybackType()
stop
Stops playback and removes all scheduled ad breaks.

void stop();

Since : 1.0

Code example:


webapis.adframework.controller.stop()
pause
Pauses playback.

void pause() ;

Since : 1.0

Code example:


webapis.adframework.controller.pause()
resume
Resumes playback from a paused state.

void resume() ;

Since : 1.0

Code example:


webapis.adframework.controller.resume()
jumpForward
Jumps the video forward a number of seconds. If a Linear Ad is playing, the Controller will instead attempt to skip the current ad. Analogous to AVPlayer's JumpForward

void jumpForward(long second) ;

Since : 1.0

Parameters:

  • seconds: Seconds to jump

Code example:


webapis.adframework.controller.jumpForward(30)
jumpBackward
Jumps the video backward a number of seconds. nalogous to AVPlayer's JumpBackward

void jumpBackward(long second) ;

Since : 1.0

Parameters:

  • seconds: Seconds to jump

Code example:


webapis.adframework.controller.jumpBackward(30)
signalTrickPlayStart
Signals to the ad framework that trickplay has started and to not trigger any ad breaks. This will not start any actual video trick play - it will simply prevent the ad framework from triggering any ad breaks while trickplay is occurring.

void signalTrickPlayStart() ;

Since : 1.0

Code example:


webapis.adframework.controller.signalTrickPlayStart()
signalTrickPlayStop
Signals to the ad framework that trickplay has ended and to trigger ad breaks according to FF_MIDROLL_BEHAVIOR.

void signalTrickPlayStop() ;

Since : 1.0

Code example:


webapis.adframework.controller.signalTrickPlayStop()
signalMuted
Signals to the ad framework that video has been muted. The ad framework sends a tracking event if necessary. This API is only designed to send tracking events to the ad server if the ad has been muted, nothing more.

void signalMuted() ;

Since : 1.0

Code example:


webapis.adframework.controller.signalMuted()
signalUnmuted
Signals to the ad framework that video has been muted. The ad framework sends a tracking event if necessary. This API is only designed to send tracking events to the ad server if the ad has been muted, nothing more.

void signalUnmuted() ;

Since : 1.0

Code example:


webapis.adframework.controller.signalUnmuted()
getDuration
Gets the duration of the currently playing video.Analogous to SEF Player's GetDuration

long getDuration() ;

Since : 1.0

Return value:

long Duration (milliseconds)

Code example:


var ms = webapis.adframework.controller.getDuration()
setDisplayRect
Sets the display area of the video frame.Relative to current window size

void setDisplayRect(AdFrameworkDisplayRect displayRect) ;

Since : 1.0

Parameters:

  • params: Object(x,y,w,h) x: x axis
    y: y axis
    w: width
    h: height

Code example:


webapis.adframework.controller.setDisplayRect({x:0, y:0, w:1920, h: 1080})
getDisplayRect
Gets the display area of the video frame. Relative to current window size

AdFrameworkDisplayRect getDisplayRect() ;

Since : 1.0

Return value:

Object(x,y,w,h)
x: x axis
y: y axis
w: width
h: height

Code example:


var displayArea = webapis.adframework.controller.getDisplayRect();
var width = displayArea.w;
getPlayhead
Gets Playhead (current playback time) of current video, whether it is an ad or content video.

long getPlayhead() ;

Since : 1.0

Return value:

long playhead (milliseconds)

Code example:


var ms = webapis.adframework.controller.getPlayhead()
getContentPlayhead
Gets Playhead (current playback time) of content video. If an ad is playing, this API will report the last known location of the content video.

long getContentPlayhead() ;

Since : 1.0

Return value:

long playhead (milliseconds)

Code example:


var ms = webapis.adframework.controller.getContentPlayhead()
setContentPlayhead
Sets the content playhead to the specified number of milliseconds. The content will jump there.

void setContentPlayhead(long milliseconds) ;

Since : 1.0

Parameters:

  • playhead: Milliseconds

Code example:


webapis.adframework.controller.setContentPlayhead(5000)
offsetContentPlayhead
Adds or subtract from the content playhead by the specified number of milliseconds. The content will jump there.

void offsetContentPlayhead(long milliseconds) ;

Since : 1.0

Parameters:

  • duration: Milliseconds

Code example:


webapis.adframework.controller.offsetContentPlayhead(5000)
getAdPlayhead
Gets Playhead (current playback time) of current Linear Ad. If content video is playing, this API will return null.

long getAdPlayhead() ;

Since : 1.0

Return value:

long playhead (milliseconds)

Code example:


var ms = webapis.adframework.controller.getAdPlayhead()
getAdBreakTimes
Gets a list of all ad breaks for the currently playing content. The return value will be a list of integers, representing milliseconds.

long[] getAdBreakTimes() ;

Since : 1.0

Return value:

Array Array of long(integer) representing the millisecond offsets of ad break times.

Code example:


var list = webapis.adframework.controller.getAdBreakTimes();
var firstAdBreakMs = list[0];
isPlayingLinearAd
Gets a Boolean representing whether a linear ad is playing or not

boolean isPlayingLinearAd() ;

Since : 1.0

Return value:

boolean
true: boolean value representing when a linear ad is playing
false: boolean value representing when a linear ad is not playing

Code example:


if(webapis.adframework.controller.isPlayingLinearAd()) {
console.log("Playing linear ad!");
}
disableAdInsertion
Disables all ad insertion. Ad breaks will no longer be triggered, and any currently playing adbreaks will abruptly end.

void disableAdInsertion() ;

Since : 1.0

Code example:


webapis.adframework.controller.disableAdInsertion()
enableAdInsertion
If ad insertion has been disabled, this re-enables the functionality. Midrolls that have already been skipped will not play, but midrolls scheduled in the future will play.

void enableAdInsertion() ;

Since : 1.0

Code example:


webapis.adframework.controller.enableAdInsertion()
getPlayer
Returns the Avplayer instance that the ad framework is using to play video.

AdFrameworkPlayerAdapter getPlayer() ;

Since : 1.0

Return value:

sefAdapter SEF adapter that the ad framework uses to control video playback.

Code example:


webapis.adframework.controller.getPlayer()
setCompanionAdHandler
Specifies a function to execute when companion ads are triggered.

void setCompanionAdHandler(AdFrameworkCompanionAdCallback oncompanionad) ;

Since : 1.0

Parameters:

  • function: Function to execute

Code example:


webapis.adframework.controller.setCompanionAdHandler(function(evt, params) {
alert(params.companionCreative);
})
getVersion
Provide buildVersion and buildDate of AdFramework

DOMString getVersion() ;

Since : 1.0

Return value:

DOMString buildVersion + " | " + buildDate

Code example:


webapis.adframework.controller.getVersion()

2.13. AdFrameworkEvents

The Events interface of AdFramework allows the developer to listen to various events related to AdFramework and its playback of content and ad video.

[NoInterfaceObject] interface AdFrameworkEvents {
        void addListener(AdFrameworkEvent eventName, AdFrameworkEventCallback handler, optional boolean removeOnExecute);
        void removeListener(AdFrameworkEvent eventName, Callback handler);
};

Since : 1.0

Methods

addListener
Listens for a specific event, and executes the specified function each time that event occurs

void addListener(AdFrameworkEvent eventName, AdFrameworkEventCallback handler, optional boolean removeOnExecute);

Since : 1.0

Parameters:

  • event: Event type to listen to
  • handler: Function to execute when event is triggered
  • removeOnExecute [OPTIONAL]: If true, the handler will only be executed on the next occurrence of the event

Code example:


var func = function() {
alert("Adbreak Start!");
};
webapis.adframework.events.addListener('ADBREAK_START', func, false)
removeListener
Removes an event listener

void removeListener(AdFrameworkEvent eventName, Callback handler) ;

Since : 1.0

Parameters:

  • event: Event type to remove handler from
  • handler: Function to remove

Code example:


var func = function() {
alert("Adbreak Start!");
};
webapis.adframework.events.addListener('ADBREAK_START', func, false);

webapis.adframework.events.removeListener('ADBREAK_START', func)

2.14. AdFrameworkPlayerAdapter

The PlayerAdapter of AdFramework allows platform-agnostic video playback. Developers usually do not have to touch the PlayerAdapter unless doing lower-level work.

[NoInterfaceObject] interface AdFrameworkPlayerAdapter {
        void addListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback, optional boolean removeOnExecute);
        void removeListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback);
};

Since : 1.0

Methods

addListener
Listens for a specific event, and executes the specified function each time that event occurs

void addListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback, optional boolean removeOnExecute);

Since : 1.0

Parameters:

  • event: Event type to listen to
  • handler: Function to execute when event is triggered
  • removeOnExecute [OPTIONAL]: If true, the handler will only be executed on the next occurrence of the event

Code example:


var func = function(){ alert("ERROR!"); }

webapis.adframework.controller.getPlayer().addListener('RENDER_ERROR', func, false);
removeListener
Removes an event listener

void removeListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback);

Since : 1.0

Parameters:

  • event: Event type to remove handler from
  • handler: Function to remove

Code example:


var func = function(){ alert("ERROR!"); }

webapis.adframework.controller.getPlayer().addListener('RENDER_ERROR', func, false);

webapis.adframework.controller.getPlayer().removeListener('RENDER_ERROR', func)

2.15. AdFrameworkConfig

The Config class of AdFramework allows the developer to customize the behavior of AdFramework.

[NoInterfaceObject] interface AdFrameworkConfig {
        void set(DOMString attributeName, any configurationValue);
        any get(DOMString attributeName);
};

Since : 1.0

Methods

set
Sets the value of a configuration parameter.

void set(DOMString attributeName, any configurationValue);

Since : 1.0

Parameters:

  • attributeName: The name of the variable
  • configurationValue: The value of the variable

Code example:


webapis.adframework.config.set("AJAX_TIMEOUT", 5000)
get
Gets the value of a configuration parameter.

any get(DOMString attributeName);

Since : 1.0

Parameters:

  • attributeName: The name of the variable to read

Return value:

configurationValue The value of the requested variable. It can be Number, boolean, or DOMString

Code example:


var timeoutMS = webapis.adframework.config.get("AJAX_TIMEOUT")

2.16. AdFrameworkVisualOverlay

The VisualOverlay class of AdFramework allows the developer to control various aspects of the Ad UI.

[NoInterfaceObject] interface AdFrameworkVisualOverlay {
        void simulateVideoClick();
        void simulateNonLinearClick();
        void setIFrameSandboxParameters(DOMString sandboxParameters);
};

Since : 1.0

Methods

simulateVideoClick
Simulates the user clicking on a Linear video ad (i.e. from a remote keypress). This will most likely open an iFrame to the target website (depending on the ad)

void simulateVideoClick();

Since : 1.0

Code example:


adVisitSiteButton.onKeyEvent(function(evt) {
 if(evt.keyCode === TvKey.KEY_ENTER) {
  //If the button is clicked, simulate a click on the video ad and visit the ad's website
  webapis.adframework.visualoverlay.simulateVideoClick()
 }
});
simulateNonLinearClick
Simulates the user clicking on a NonLinear ad (i.e. from a remote keypress). This will most likely open an iFrame to the target website (depending on the ad)

void simulateNonLinearClick();

Since : 1.0

Code example:


adVisitSiteButton.onKeyEvent(function(evt) {
 if(evt.keyCode === TvKey.KEY_ENTER) {
  //If the button is clicked, simulate a click on the nonlinear ad and visit the ad's website
  webapis.adframework.visualoverlay.simulateNonLinearClick()
 }
});
setIFrameSandboxParameters
Sets the sandbox parameters of the Ad Framework iFrame. By default, the sandbox is restrictive.

void setIFrameSandboxParameters(DOMString sandboxParameters);

Since : 1.0

Parameters:

  • The properties to be set: When it's called, it sets parameters sent as parameters

Code example:


webapis.adframework.visualoverlay.setIFrameSandboxParameters("allow-forms allow-popups allow-same-origin")

3. Full WebIDL


module AdFramework  {
    enum AdFrameworkPlaybackType { "STOPPED", "CONTENT", "LINEAR_AD" , "INTERACTIVE_AD"};

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkBeforeLinearAdStartCallback {
        void onbeforelinearadstart(object player);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkAfterLinearAdStartCallback {
        void onafterlinearadstart(object player);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkBeforeLinearContentStartCallback {
        void onbeforecontentstart(object player);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkAfterLinearContentStartCallback {
        void onaftercontentstart(object player);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkLinearAdUrlCallback {
        void onlinearadurl(DOMString url);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkTrackingUrlCallback {
        void ontrackingurl(DOMString url);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkErrorUrlModifierCallback {
        void onerrorurl(DOMString url);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkCompanionAdCallback {
        void oncompanionad(object ad);
    };

    [Callback = FunctionOnly, NoInterfaceObject] interface AdFrameworkEventCallback {
        void onevent(AdFrameworkPlayerAdapterEvent event, object params);
    };

    dictionary AdFrameworkDisplayRect {
        long x;
        long y;
        long w;
        long h;
    };

    dictionary AdFrameworkInitializationObject {
        DOMString playerID1;
        DOMString playerID2;
        DOMString adapterType;
    };


    [NoInterfaceObject] interface AdFrameworkManagerObject {
         readonly attribute AdFrameworkManager adframework;
    };

    WebApi implements AdFrameworkManagerObject;

    [NoInterfaceObject] interface AdFrameworkManager {
        readonly attribute AdFrameworkVisualOverlay visualoverlay;
        readonly attribute AdFrameworkController controller;
        readonly attribute AdFrameworkEvents events;
        readonly attribute AdFrameworkConfig config;
    };

    [NoInterfaceObject] interface AdFrameworkController {
         void initialize(optional AdFrameworkInitializationObject params);
         void open(DOMString contentUrl, DOMString vmapUrl);
         void startPlayback(optional long playhead) ;
         void setBeforeContentStartHandler(AdFrameworkBeforeLinearContentStartCallback onbeforecontentstart) ;
         void setBeforeLinearAdStartHandler(AdFrameworkBeforeLinearAdStartCallback onbeforelinearadstart) ;
         void setAfterContentStartHandler(AdFrameworkAfterLinearContentStartCallback onaftercontentstart) ;
         void setAfterLinearAdStartHandler(AdFrameworkAfterLinearAdStartCallback onafterlinearadstart) ;
         void changeContentUrl(DOMString contentUrl) ;
         void setLinearAdUrlModifier(AdFrameworkLinearAdUrlCallback onlinearadurl) ;
         void setTrackingUrlModifier(AdFrameworkTrackingUrlCallback ontrackingurl) ;
         void setErrorUrlModifier(AdFrameworkErrorUrlModifierCallback onerrorurl) ;
         void insertAdBreak(DOMString xmlUrl, object params) ;
         void playAdImmediately(DOMString xmlUrl) ;
         void bufferStandaloneAd(DOMString xmlUrl) ;
         void playBufferedStandaloneAd() ;
         AdFrameworkPlaybackType getCurrentPlaybackType() ;
         void stop() ;
         void pause() ;
         void resume() ;
         void jumpForward(long second) ;
         void jumpBackward(long second) ;
         void signalTrickPlayStart() ;
         void signalTrickPlayStop() ;
         void signalMuted() ;
         void signalUnmuted() ;
         long getDuration() ;
         void setDisplayRect(AdFrameworkDisplayRect displayRect) ;
         AdFrameworkDisplayRect getDisplayRect() ;
         long getPlayhead() ;
         long getContentPlayhead() ;
         void setContentPlayhead(long milliseconds) ;
         void offsetContentPlayhead(long milliseconds) ;
         long getAdPlayhead() ;
         long[] getAdBreakTimes() ;
         boolean isPlayingLinearAd() ;
         void disableAdInsertion() ;
         void enableAdInsertion() ;
         AdFrameworkPlayerAdapter getPlayer() ;
         void setCompanionAdHandler(AdFrameworkCompanionAdCallback oncompanionad) ;
         DOMString getVersion();
    };

    enum AdFrameworkEvent {
        "PLAYBACK_TIME",
        "AD_PLAYBACK_TIME",
        "CONTENT_PLAYBACK_TIME",
        "ADBREAK_INSERTION_SUCCESS",
        "ADBREAK_INSERTION_FAILURE",
        "PLAYBACK_COMPLETE",
        "LINEAR_AD_PREBUFFER_START",
        "LINEAR_AD_START",
        "LINEAR_AD_END",
        "LINEAR_AD_COMPLETE",
        "NONLINEAR_AD_START",
        "NONLINEAR_AD_END",
        "ADBREAK_START",
        "ADBREAK_END",
        "CONTENT_PREBUFFER_START",
        "CONTENT_SUSPEND",
        "CONTENT_START",
        "IFRAME_OPEN",
        "IFRAME_CLOSE",
        "TRACKING_EVENT",
        "ERROR_TRACKER",
        "COMPANION_ADS_CREATIVE_DETECTED",
        "COMPANION_AD_FAILED_REQUIRED_ALL",
        "COMPANION_AD_FAILED_REQUIRED_ANY",
        "COMPANION_AD_START",
        "VPAID_COMPLETE",
        "VPAID_LINEARITY_CHANGE",
        "VPAID_ERROR",
        "VPAID_LINEAR_PLAYBACK_TIME",
        "PARSING_ERROR",
        "UNRECOVERABLE_PLAYBACK_ERROR",
        "RECOVERABLE_PLAYBACK_ERROR",
        "VSUITE_PLAYBACK_ERROR",
        "PLAYBACK_TYPE",
        "DEBUG_MESSAGE"
    };

    [NoInterfaceObject] interface AdFrameworkEvents {
         void addListener(AdFrameworkEvent eventName, AdFrameworkEventCallback handler, optional boolean removeOnExecute);
         void removeListener(AdFrameworkEvent eventName, Callback handler);
    };

    enum AdFrameworkPlayerAdapterEvent {
        "CURRENT_PLAYBACK_TIME",
        "SUBTITLE",
        "CUSTOM",
        "SPARSE_TRACK",
        "RENDER_ERROR",
        "PLAYER_EXCEPTION",
        "STREAM_INFO_READY",
        "STREAM_STOPPED",
        "RENDERING_START",
        "RENDERING_COMPLETE",
        "BUFFERING_START",
        "BUFFERING_PROGRESS",
        "BUFFERING_COMPLETE",
        "RESOLUTION_CHANGED",
        "BITRATE_CHANGED",
        "AD_START",
        "AD_END",
        "DECODING_COMPLETE",
        "CONNECTION_FAILED",
        "AUTHENTICATION_FAILED",
        "STREAM_NOT_FOUND",
        "NETWORK_DISCONNECTED",
        "NETWORK_SLOW",
        "PREBUFFERING_CURRENT_PLAYBACK_TIME",
        "PREBUFFERING_BUFFERING_PROGRESS",
        "PREBUFFERING_SUBTITLE",
        "PREBUFFERING_CUSTOM",
        "PREBUFFERING_SPARSE_TRACK",
        "PREBUFFERING_RENDER_ERROR",
        "PREBUFFERING_STREAM_INFO_READY",
        "PREBUFFERING_RENDERING_START",
        "PREBUFFERING_RENDERING_COMPLETE",
        "PREBUFFERING_BUFFERING_START",
        "PREBUFFERING_BUFFERING_COMPLETE",
        "PREBUFFERING_RESOLUTION_CHANGED",
        "PREBUFFERING_BITRATE_CHANGED",
        "PREBUFFERING_AD_START",
        "PREBUFFERING_AD_END",
        "PREBUFFERING_DECODING_COMPLETE",
        "PREBUFFERING_CONNECTION_FAILED",
        "PREBUFFERING_AUTHENTICATION_FAILED",
        "PREBUFFERING_STREAM_NOT_FOUND",
        "PREBUFFERING_NETWORK_DISCONNECTED",
        "PREBUFFERING_NETWORK_SLOW"
    };

    [NoInterfaceObject] interface AdFrameworkPlayerAdapter {
         void addListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback, optional boolean removeOnExecute);
         void removeListener(AdFrameworkPlayerAdapterEvent eventName, Callback eventCallback);
    };

    [NoInterfaceObject] interface AdFrameworkConfig {
         void set(DOMString attributeName, any configurationValue);
         any get(DOMString attributeName);
    };

    [NoInterfaceObject] interface AdFrameworkVisualOverlay {
         void simulateVideoClick();
         void simulateNonLinearClick();
         void setIFrameSandboxParameters(DOMString sandboxParameters);
    };
};