Packagese.videoplaza.kit.api.events
Classpublic class VpEventType



Public Constants
 ConstantDefined by
  AD_ERROR_EVENT : String = "adErrorEvent"
[static] Dispatched when an AdError has occurred.
VpEventType
  AD_MODULE_CREATED : String = "vpAdModuleCreated"
[static]
VpEventType
  AD_PLAYER_COMPLETE : String = "vpAdPlayerComplete"
[static] Dispatched when an ad session has completed, after the video player has informed the AdPlayer that its item has ended by calling adPlayer.setPlayerState(CLIP_COMPLETE) The video player should not proceed to the next step until the AdPlayer has dispatched this event.
VpEventType
  AD_PLAYER_ERROR : String = "vpAdPlayerError"
[static] Dispatched if the AdPlayer can not load its skin or font file.
VpEventType
  AD_PLAYER_MUTED : String = "vpAdPlayerMuted"
[static]
VpEventType
  AD_PLAYER_READY : String = "vpAdPlayerReady"
[static] Dispatched after setNewItem(item:ItemInfo) has been correctly called, and the AdPlayer is ready to start the session Before this, the player should not start the stream.
VpEventType
  AD_PLAYER_VOLUME_CHANGE : String = "vpAdPlayerVolumeChange"
[static]
VpEventType
  ADS_CREATED : String = "vpAdsCreated"
[static] Dispatched when the the Session is updated with additional InsertionPoints.
VpEventType
  BEGIN_BUFFER : String = "vpBeginBuffer"
[static]
VpEventType
  DEBUG : String = "vpDebug"
[static]
VpEventType
  Event : String = "vpEvent"
[static] (Javascript Event API 2.0)
VpEventType
  FORMAT_CREATED : String = "vpFormatCreated"
[static] Dispatched when the AdPlayer has created a format module.
VpEventType
  ON_EVENT : String = "vpOnEvent"
[static] Dispatched when the user has changed the volume of an ad within the AdPlayer.
VpEventType
  SESSION_ERROR_EVENT : String = "sessionErrorEvent"
[static] Dispatched when a SessionError has occurred.
VpEventType
  TRACKING_ERROR_EVENT : String = "trackingErrorEvent"
[static] Dispatched when a tracking URL fails.
VpEventType
Constant detail
AD_ERROR_EVENTconstant
public static const AD_ERROR_EVENT:String = "adErrorEvent"

Dispatched when an AdError has occurred.


Example
Retrieve the object carrying data on the error like this:
   private function onAdError(evt:Event):void {
     var adError:Object = Object(evt).getData();
   }
   

The returned object looks like this:
         adError.ad = the ad associated with the tracking. // Object type. e.g: ad.id for the ad id.
   adError.errorCode = "100" //The Error Code for the error, as described in VAST 3.
         adError.thirdPartySourceURL = The first third party vast url for the ad that caused the error.
   adError.detailedMessage = "Could not parse third party ad.[etc]" //A message with details on the error.
   adError.type = VpEventType.AD_ERROR_EVENT //String type
   
See the JavaScript event API 2.0 documentation for the ad properties. The detailedMessage property will provide explicit information about what has gone wrong, while the ErrorCode provides a category for the occurred error. Available error codes:
Error Code Description
100 XML parsing error. Triggered when XML parsing fails due to malformed XML.
101 VAST schema validation error. Triggered when retrieved XML does not adhere to the VAST XSD schema.
200 Trafficking error. Triggered when the ad player received an Ad type that it was not expecting and/or cannot display.
201 Expecting different linearity. Triggered when the actual linearity of an Ad is different than declared in the VAST ticket.
300 General wrapper error. Triggered when a VAST wrapper Ad fails because of reasons not covered by other Error Codes.
301 Timeout of VAST URI provided in Wrapper element, or of VAST URI provided in a subsequent Wrapper element (URI was either unavailable or reached a timeout as defined by the SDK or in the Ooyala Pulse settings).
302 Wrapper limit reached, as defined by the Ooyala Pulse account settings. Too many Wrapper responses have been received with no InLine response.
303 No Ads VAST response after one or more Wrappers. The ad call resulted in an explicit No Ads response.
400 General Linear error. Ad player is unable to display the Linear Ad, because of reasons not covered by other error codes.
405 Problem displaying MediaFile. Ad player found a MediaFile with supported type but couldn’t display it. May include: unsupported codecs, different MIME type than MediaFile@type, unsupported delivery method, etc.
500 General NonLinear Error. Ad player is unable to display the NonLinear Ad, because of reasons not covered by other error codes.
502 Unable to fetch NonLinearAds/NonLinear resource.
600 General CompanionAds error. Ad player is unable to display the CompanionAd, because of reasons not covered by other error codes.
603 Unable to fetch CompanionAds/Companion resource.
604 Couldn’t find Companion resource with supported type.
900 Undefined Error. An error occurred that is not covered by other error codes.
901 General VPAID Error. A VPAID error occurred.
For a list of all Error Codes, please visit VAST 3 Specification

AD_MODULE_CREATEDconstant 
public static const AD_MODULE_CREATED:String = "vpAdModuleCreated"
AD_PLAYER_COMPLETEconstant 
public static const AD_PLAYER_COMPLETE:String = "vpAdPlayerComplete"

Dispatched when an ad session has completed, after the video player has informed the AdPlayer that its item has ended by calling adPlayer.setPlayerState(CLIP_COMPLETE) The video player should not proceed to the next step until the AdPlayer has dispatched this event.

AD_PLAYER_ERRORconstant 
public static const AD_PLAYER_ERROR:String = "vpAdPlayerError"

Dispatched if the AdPlayer can not load its skin or font file.

AD_PLAYER_MUTEDconstant 
public static const AD_PLAYER_MUTED:String = "vpAdPlayerMuted"
AD_PLAYER_READYconstant 
public static const AD_PLAYER_READY:String = "vpAdPlayerReady"

Dispatched after setNewItem(item:ItemInfo) has been correctly called, and the AdPlayer is ready to start the session Before this, the player should not start the stream.

AD_PLAYER_VOLUME_CHANGEconstant 
public static const AD_PLAYER_VOLUME_CHANGE:String = "vpAdPlayerVolumeChange"
ADS_CREATEDconstant 
public static const ADS_CREATED:String = "vpAdsCreated"

Dispatched when the the Session is updated with additional InsertionPoints.

The object returned can be parsed to find out how many Prerolls and Midrolls (including companions) will be displayed during the session.

NOTE!The returned object currently only represents Prerolls, Midrolls and CompanionBanners existing in the Session. Complete Session information is not available.


Example
The following code illustrates a way to parse the returned data object to display a simplified version of the session:
   private function onAdsCreated(evt:Event):void {
    output(Object(evt).getData());
   }
   
   private function output(oObj:Object, sPrefix:String = ""):void  {  
    sPrefix == "" ? sPrefix = "-- " : sPrefix += "-- ";  
    for (var i:String in oObj) {
     trace(sPrefix + i + " : " + oObj[i] + "  ");    
     if (oObj[i] is Object) {
      output( oObj[i], sPrefix);
     }
    }  
   } 
   
Resulting trace from above will take this form (actual format types will differ depending on actual session):
   companion : [object Object]
   -- -- 0 : [object Object]
   -- -- -- type : companion
   -- -- -- ads : 3
   -- -- -- time : 0
   -- -- 60.127 : [object Object]
   -- -- -- type : companion
   -- -- -- ads : 2
   -- -- -- time : 60.127
   -- -- 30.23 : [object Object]
   -- -- -- type : companion
   -- -- -- ads : 2
   -- -- -- time : 30.23
   -- spot : [object Object]
   -- -- 0 : [object Object]
   -- -- -- type : spot
   -- -- -- ads : 2
   -- -- -- time : 0
   -- -- 60.127 : [object Object]
   -- -- -- type : spot
   -- -- -- ads : 2
   -- -- -- time : 60.127
   -- -- 30.23 : [object Object]
   -- -- -- type : spot
   -- -- -- ads : 2
   -- -- -- time : 30.23
   -- splash : [object Object]
   -- inskin : [object Object]
   -- overlay : [object Object]
    

BEGIN_BUFFERconstant 
public static const BEGIN_BUFFER:String = "vpBeginBuffer"
DEBUGconstant 
public static const DEBUG:String = "vpDebug"
Eventconstant 
public static const Event:String = "vpEvent"

(Javascript Event API 2.0)

FORMAT_CREATEDconstant 
public static const FORMAT_CREATED:String = "vpFormatCreated"

Dispatched when the AdPlayer has created a format module. A module handles all ads of a given format. The name of the created format is sent in the data parameter. Each module can be accessed through AdPlayer.getFormat(formatName).

ON_EVENTconstant 
public static const ON_EVENT:String = "vpOnEvent"

Dispatched when the user has changed the volume of an ad within the AdPlayer. The video player should adapt to the new volume (by calling adPlayer.getVolume()

SESSION_ERROR_EVENTconstant 
public static const SESSION_ERROR_EVENT:String = "sessionErrorEvent"

Dispatched when a SessionError has occurred. There are four different main categories for session errors; "Invalid Response", "Invalid Argument", "Request Failed" and "Request Timeout". A detailed message will begin with one of these categories, followed by explicit information about occurred error.


Example
Retrieve the object carrying data on the error like this:
   private function onSessionError(evt:Event):void {
     var sessionError:Object = Object(evt).getData();
   }
   

The returned object looks like this:
   sessionError.detailedMessage = "Invalid Response: [etc]" //A message with details on the error.
   sessionError.type = VpEventType.SESSION_ERROR_EVENT //String type
   
See the JavaScript event API 2.0 documentation for the ad properties.

TRACKING_ERROR_EVENTconstant 
public static const TRACKING_ERROR_EVENT:String = "trackingErrorEvent"

Dispatched when a tracking URL fails.


Example
Retrieve the object carrying data like this:
   private function onTrackerEvent(evt:Event):void {
     var trackingError:Object = Object(evt).getData();
   }
   

The returned object looks like this:
   trackingError.ad = the ad associated with the tracking. // Object type. e.g: ad.id for the ad id.
   trackingError.trackingEvent // see se.videoplaza.kit.api.constants.TrackingEvent.
   trackingError.statusCode = 200 ,The response status code for the http request. //Int type
   trackingError.URL = "http://url....". The tracking url that failed. //String type
   trackingError.message = Message describing the cause of failure. //String type
   
See the JavaScript event API 2.0 documentation for the ad properties.