Show a Video 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 showing video ads with Prebid.js, see Show Video Ads with DFP.

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 pre-roll 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.

Examples

Click here to view a demo page with this example.

Click Edit in JSFiddle (below) to open the example in a new tab.

Troubleshooting Common Issues

For tips and troublshooting info, see: