Class adways.iab.vast.Loader

Extends: adways.event.EventDispatcher

Loader class description

adways.iab.vast.Loader( ) public

<Number> addEventListener( kind, callback, [instance=null], [priority=0], [useWeakReference=false] ) public
Adds an event listener of a specific event kind.

Parameters:

  • kind <Constant>
    kind of the event to listen
  • callback <FUNCTION>
    function called when the event is fired
  • [instance=null] <Object> optional
    callback's instance. Useful when the callback is binded to an object:
                        Class = function () {};
                        Class.prototype.callback = function () {};
                        var a = new Class();
                        aDispatcher.addEventListener(AN_EVENT_KIND, a.callback, a);
  • [priority=0] <Number> optional
    priority
  • [useWeakReference=false] <Boolean> optional
    not yet used
Return: <Number>: 1 if event added, 0 otherwise (already added callback). When instance==null, the callback should be accessible from the global context and be a "static" method. Exemple:
                    namespaceA.subnamespace.myCallback = function (event) {
                        ...
                    };
                    aDispatcher.addEventListener(AN_EVENT_KIND, namespaceA.subnamespace.myCallback);
<adways.iab.vast.VPAIDObject> getCompanions( [depth=-1] ) public

Returns Companion ads associated to this loader.

Parameters:

  • [depth=-1] <Number> optional

    level of depth to find associated ads, -1 means all.

Return: <adways.iab.vast.VPAIDObject>:

array of companion.

<String> getDelegateBuilderClassname( ) public

Returns the delegate builder class name.

Return: <String>:

delegate builder class name.

<String> getDelegateBuilderURL( ) public

Returns the delegate builder url.

Return: <String>:

delegate builder url.

<adways.iab.vast.VPAIDObject> getLinears( [depth=-1] ) public

Returns Linear ads associated to this loader.

Parameters:

  • [depth=-1] <Number> optional

    level of depth to find associated ads, -1 means all.

Return: <adways.iab.vast.VPAIDObject>:

array of linear ads.

<adways.iab.vast.VPAIDObject> getNonLinears( [depth=-1] ) public

Returns Non-linear ads associated to this loader.

Parameters:

  • [depth=-1] <Number> optional

    level of depth to find associated ads, -1 means all.

Return: <adways.iab.vast.VPAIDObject>:

array of non-linear ads.

<String> getPlayerClass( ) public

Returns the player class.

Return: <String>:

player class.

<number> getRendererSize( ) public

Returns ad render size.

Return: <number>:

two entry number array with width and height.

<DOMElement> getSlot( ) public

Returns the slot.

Return: <DOMElement>:

slot.

<String> getVAST_URL( ) public

Returns the VAST url.

Return: <String>:

VAST url.

<Xml> getVAST_XML( ) public

Returns the vast xml file.

Return: <Xml>:

vast xml file.

<VastFileStates> getVASTFileState( ) public

Returns the loader vast xml file state.

Return: <VastFileStates>:

vast xml file state.

<Object> getVideoSlot( ) public

Returns the video slot. (old getPlayerAPI)

Return: <Object>:

main video player API pointer.

<[adways.iab.vast.Loader]> getWrapped( [depth=-1] ) public

Returns Wrappers associated to this loader.

Parameters:

  • [depth=-1] <Number> optional

    level of depth to find associated ads, -1 means all.

Return: <[adways.iab.vast.Loader]>:

array of wrappers.

<Number> hasEventListener( kind, callback, [instance=null] ) public
Whether or not a listener has already been added.

Parameters:

  • kind <Constant>
    the event's kind
  • callback <FUNCTION>
    the listener's function
  • [instance=null] <Object> optional
    the listener callback's instance
Return: <Number>: the listeners count.
<Number> nbEventListeners( kind ) public
Counts the listeners added for a specific event.

Parameters:

  • kind <Constant>
    the event's kind
Return: <Number>: the listeners count.
<Number> removeAllEventListeners( ) public
Removes all the listeners.
Return: <Number>: 1 on success (currently always), 0 otherwise.
<Number> removeEventListener( kind, callback, [instance=null] ) public
Removes an event listener of a specific event kind.

Parameters:

  • kind <Constant>
    kind of the event to listen
  • callback <FUNCTION>
    function called when the event is fired
  • [instance=null] <Object> optional
    callback's instance
Return: <Number>: 1 if event removed, 0 otherwise ( couple < instance + callback > not found).
<Number> requestVAST( [VAST_URL=&#x27;&#x27;] ) public

Requests the VAST file.

Parameters:

  • [VAST_URL=''] <String> optional
Return: <Number>:
  • 1: request launched
  • -1: arguments error: no vast URL to request
  • -2: arguments error: videoSlot is not set
  • -3: arguments error: playerClass is not set and delegateBuilderURL or delegateBuilderClassname are not set
  • -4: arguments error: vastFileState is not URL_CHANGED
<Number> setDelegateBuilderClassname( name ) public

Set the delegate builder class name.

Parameters:

  • name <String>

    delegate builder class name.

Return: <Number>:
  • 1: delegate builder class name set with success
  • 0: current delegate builder class name is the same as the new one
  • -1: arguments error: not enough arguments
  • -2: arguments error: arguments[0] is not a string
  • -3: arguments error: vastFileState is neither vastFileStates.EMPTY empty nor vastFileStates.URL_CHANGED
<Number> setDelegateBuilderURL( url ) public

Set the delegate builder url.

Parameters:

  • url <String>

    delegate builder url.

Return: <Number>:
  • 1: delegate builder url set with success
  • 0: current delegate builder url is the same as the new one
  • -1: arguments error: not enough arguments
  • -2: arguments error: arguments[0] is not a string
  • -3: arguments error: vastFileState is neither vastFileStates.EMPTY empty nor vastFileStates.URL_CHANGED
<Number> setPlayerClass( playerClass ) public

Set the player class.

Parameters:

  • playerClass <String>

    player class identifier.

Return: <Number>:
  • 1: player class set with success
  • 0: current player class is the same as the new one
  • -1: arguments error: not enough arguments
  • -2: arguments error: arguments[0] is not a string
  • -3: arguments error: vastFileState is neither vastFileStates.EMPTY empty nor vastFileStates.URL_CHANGED
<Number> setRendererSize( width, height ) public

Set the ad render size.

Parameters:

  • width <Number>

    ad width.

  • height <Number>

    ad height.

Return: <Number>:
  • 1: render size set with success
  • 0: render size is the same as the new one
  • -1: arguments error: not enough arguments
  • -2: arguments error: arguments[0] is not a number
  • -3: arguments error: arguments[1] is not a number
  • -3: arguments error: vastFileState is neither vastFileStates.EMPTY empty nor vastFileStates.URL_CHANGED
<Number> setSlot( slot ) public

Set the slot that will be transmit to the VPAID object.

Parameters:

  • slot <DOMElement>

    slot that will be transmit to the VPAID object.

Return: <Number>:
  • 1: slot set with success
  • 0: current slot is the same as the new one
  • -1: arguments error: not enough arguments
  • -2: arguments error: arguments[0] is not a object
  • -3: arguments error: vastFileState is neither vastFileStates.EMPTY empty nor vastFileStates.URL_CHANGED
<Number> setVAST_URL( url ) public

Set the VAST url.

Parameters:

  • url <String>

    VAST url to request.

Return: <Number>:
  • 1: VAST url set with success
  • 0: current VAST url is the same as the new one
  • -1: arguments error: not enough arguments
  • -2: arguments error: arguments[0] is not a string
  • -3: arguments error: vastFileState is neither vastFileStates.EMPTY empty nor vastFileStates.URL_CHANGED
<Number> setVideoSlot( videoSlot ) public

Set the main video Player API. (old setPlayerAPI)

Parameters:

  • videoSlot <Object>

    Main video player API pointer.

Return: <Number>:
  • 1: videoSlot set with success
  • 0: current videoSlot is the same as the new one
  • -1: arguments error: not enough arguments
  • -2: arguments error: arguments[0] is not an object
  • -3: arguments error: vastFileState is neither vastFileStates.EMPTY empty nor vastFileStates.URL_CHANGED