Show a prebid ad in a cloud 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 cloud-hosted JW player.
  • Using invokeVideoPlayer to set up and access the JW Player instance.
  • Dynamically inserting 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 1, a cloud-hosted player and JW Platform hosted content. To see an example using the self-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.
  • If you're using a cloud-hosted player, do not enable advertising in the platform. We'll do it on page so that we can use the vast url from prebid.
  • You can set up most of your player's settings in the platform. The platform settings will be used unless overridden on the page in the setup call.


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: