How to Add a MACRO

What are Macros?

Macros are name and value pairings that are applied to your Player Tag embed code and used to enforce a supported functionality on a specific embed code level.

For example: If you would like to enforce a 'Click-to-play' experience just on one specific player when all your other players are set to autoplay from the Portal, you can easily add the [playback=click] macro to your Player embed code that will set the sp'Click-to-play' playback setting.

 

 

 

 

Add a Macro to your Player

To add a Macro to your player, perform the following steps:

  1. Access the player wizard by editing an existing player or creating a new one.

    Access_EMBED_TAG_Tab.jpeg

  2. Click on 'ADVANCED' and select the 'EMBED TAG' tab.

    NUI_Player_Macros_1102_.jpeg

  3. Under the 'EMBED TAG' tab, go to the 'MACROS' area.

    NUI_Player_Macros_1103_.jpeg

  4. Enter a supported macro 'NAME' and 'VALUE' according to the following table:

    Macro Name Macro Value
    responsive                Define if the player size is responsive to its parent element size:
    • 1 - True (Responsive)
    • 0 - False
    playback

    Override the player playback initialization according to the following options:

    • autoplay - The player will start playback of either Ads or content videos when the player loads.
    • autoplay_ad_only - The player will start the Ad playback when the player loads.
    • mouseover - The player will start playback when the viewer hovers over the player with the mouse cursor.
    • click - The player will start playback when the viewer clicks on the player.

    Note: All values must be lowercase.

    sound

    Override the player sound initialization according to the following options:

    • normal - The sound of the player will use the volume settings defined in the player wizard.
    • muted - The player will be muted even if the player wizard is set to playback sound.
    • mouseover - The player will playback sound according to the defined volume settings of the player wizard only when the viewer hovers over the player with the mouse cursor.
    • mouseover/off - The player will playback sound according to the defined volume settings of the player wizard as usual, but when the viewer hovers over the player with the mouse cursor, the player will be muted.

    Note: All values must be lowercase.

    fwsitesection   

    This macro is used for campaign targeting via FreeWheel. 

    Enter your FreeWheel Site Section Name in the value field.

    Note: All values must be lowercase.

    fwkeyvalues

    This macro is used for sponsorship campaigns via FreeWheel. Enter the following text into the value field:

    sponsorship%3DSPONSORSHIP_NAME

    Then replace the 'SPONSORSHIP_NAME' placeholder with your required FreeWheel sponsorship name.

    Important! This text includes includes a '%3D' ASCII value that represents an equals symbol. Make sure to keep this syntax in your macro.

    o2inline This macro is used to apply the Mobile Ad Autoplay option to your player and accepts the following options:
    • autoplay - Selecting this option will enable the Mobile Ad to playback automatically upon loading. 
    • inline - Selecting this option will enable the Mobile Ad to playback automatically when a certain percent of the player element is in the browser's viewport according to the setting you defined on the Player Playback level (the 'Autoplay when in view' field, set to either: Always, 50% or 25%).
    • off - This will disable the Mobile Ad Autoplay functionality.

    Note: All values must be lowercase.

    onLoad

    This macro is used to get hold of the player object and gain access to our player events and actions by mapping it to a custom JavaScript function.

    Add a custom function that will store the player object in your web page and enter the function's name as the value of the onLoad macro

    onLoad=yourFunction

    For further details, please see How to Get Hold of Player Events using the 'onLoad' Macro.

    htmlplayerforce

    The htmlplayerforce macro allows you to force a Flash or Smart player to load as an HTML5 player.

    Define if the player will be forced to load as an HTML5 player:

    • 1 - True (HTML5)
    • 0 - False (Loads according to original configuration either 'Smart' or 'Flash').
    timelinepreview

    The timelinepreview macro allows you to activate or deactivate the Timeline Preview functionality on your players.

    • 1 - True (Active)
    • 0 - False (Disabled)
    url

    The url macro is used with the Strict site check functionality of Ad Campings and Players to deliver ad campaigns on domains that match the specified URL

    Enter a URL address where you would like to allow ad delivery.

    URL

    Note: For further details, please see How Strick Site Check works.



  5. Click on 'Add macro'. Your macro is added to your player tag embed code.

    Important!
    When adding a supported macro using the Portal, this macro is saved on to the Player object. This means that anyone copying thisPlayer Tag will have the defined macro included.

    Important! When adding a macro to your player tag, the macro is added in two places:
    • To the Player Tag <div> - under the "vdb_params" macro declaration.
    • To the Player Tag <script> tag a - Added as a query string parameter and value to be passed to our server.

  6. Optional: Repeat steps 4-5 to apply additional Macros if required.

  7. Click on 'SAVE'. Your Player macro is applied to this player.
Have more questions? Submit a request