Schedule VAST ads (Web Player)
Add advertising breaks to your content when using the VAST ad client.
The most basic advertising implementation is to run a single VAST ad tag as a pre-roll before each playlist item.
If you are using FreeWheel, follow the steps in Enable FreeWheel Ad Manager.
If you are using a cloud-hosted player, you can create an ad schedule in your JWP dashboard and associate the ad schedule with your cloud-hosted player. The ad schedule will play in every instance of the embedded player.
Since any changes made to the
advertising
object override any advertising settings made in the dashboard, be sure to include all existing advertising dashboard configurations within theadvertising
object.
Add a pre-roll ad break to a player
Use the following steps to add a pre-roll to an embedded player:
- Within
setup()
of an embedded JWP, add an advertising object. - Define the
client
property within theadvertising
object asvast
(VAST). - Define the
adscheduleid
property within theadvertising
object. Assign a randomly-generated, eight character, alpha-numeric value to this property. - Define a schedule array within the
advertising
object. At the minimum, you must assign an ad tag to thetag
property. You can also assign the URL of a VMAP tag to theschedule
property.
As a shortcut, you can define
advertising.tag
(String) to create a single pre-roll ad break. If you use this shortcut, you cannot add multiple ad breaks.The
advertising.tag
property andadvertising.schedule[]
property cannot be used in the sameadvertising
object.
jwplayer("myElement").setup({ "playlist": "https://cdn.jwplayer.com/v2/playlists/a12bc3D4", "advertising": { "client": "vast", "adscheduleid": "Az87bY12", "schedule": [ { "tag": "https://www.domain.com/adtag.xml" } ] } });
You can build on this basic implementation by adding multiple ad breaks, defining ad rules or configuring Player Bidding.
Add multiple ad breaks to a player
Use the following steps to add multiple ad breaks to the previous VAST pre-roll example:
- Define an additional index within the advertising.schedule array.
- Assign an ad tag to the
tag
property. - When defining the
offset
property, choose one of the following values to schedule a mid-roll or post-roll ad:
Mid-roll
Β Β - {number}: (Number) Ad plays after the specified number of seconds.
Β Β - {timecode}: (String) Ad plays at a specific time, inhh:mm:ss:mmm
format.
Β Β - {xx%}: (String) Ad plays after xx% of the content has played.
Post-roll
Β Β -post
: (String) Ad plays after the content.
jwplayer("myElement").setup({ "playlist": "https://cdn.jwplayer.com/v2/media/123acb4e", "advertising": { "client": "vast", "adscheduleid": "Az87bY12", "schedule": [ { "offset": "pre", "tag": "https://www.domain.com/adtag.xml" }, { "offset": 10, "tag": "https://www.domain.com/adtag-mid-roll1.xml" }, { "offset": "00:00:15:000", "tag": "https://www.domain.com/adtag-mid-roll2.xml" }, { "offset": "25%", "tag": "https://www.domain.com/adtag-mid-roll3.xml" }, { "offset": "post", "tag": "https://www.domain.com/adtag-post-roll.xml" } ] } });
You can build on this basic implementation by defining ad rules or setting up Player Bidding.
Updated about 1 year ago