Global adTag with Flowplayer OVP managed players

The global adTag demo shows the use of globally defined adTags in Flowplayer OVP managed players.

Sample implementation

Requirements

The ad tag of the player configuration in Flowplayer OVP must be set to flowplayer://my_ad_tag_fetcher, the name of the global function defined below.

HTML code

  <div id="player-3ca57be7-6628-45e3-9f23-bba96493ac05"></div>
  <script type="module">
    import flowplayer from "https://embed.flowplayer.com/a40cfb3f-49ee-4969-bce6-336c70096aa4/3ca57be7-6628-45e3-9f23-bba96493ac05.js";
    flowplayer("#player-3ca57be7-6628-45e3-9f23-bba96493ac05", {});
  </script>

JavaScript

// use `my_ad_tag_fetcher` as the function name in the code and the OVP adTag configuration
window.my_ad_tag_fetcher = function() {
  return new Promise(resolve => {
    // we use an IMA3 sample tag here, you would use your own
    const ad_tag_url = "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator="
    resolve(ad_tag_url)
  })
};

Replace the player script and id with your own, the example only works on flowplayer.com.

Standalone demo

global adTag with OVP managed players

Results