Show a prebid ad in a self-hosted JW Player

This page is an example of using prebid video with a specific player. For a general guide to using video in prebid, click here.


This page contains:

  • Setting up JW Player to dynamically play ads.
  • Using a self-hosted player.
  • Create a masterVideoTag and pass it to invokeVideoPlayer.
  • Use invokeVideoPlayer to set up and access the JW Player instance.
  • Dynamically insert a preroll ad into JW Player.


Player specific notes:

  • You must have the correct JW Player license that allows you to play advertising.
  • The different methods of embedding JW Player on your site can be found here.
  • For this example we will be using method 3, a self-hosted player and JW Platform hosted content. To see an example using the cloud-hosted player, click here.
  • No matter what embedding method you choose to use, you must follow the custom embed instructions. You cannot use the single-line embed.


Click here to view a demo page with this example. Click Edit in JSFiddle to open the example in a new tab.

For tips and troublshooting info, see: