Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Multiple ads via API


Is there a way to use playAd in order to play 2 ads in a row?

without using ad pod / VAMP.

4 Community Answers

naortor

User  
0 rated :

I tried waiting to AdComplete event, and then run playAd again, its working ok on the preroll, but not working on postroll.

I mean when Im doing it on BeforePlay it work fine but when Im using it on BeforeComplete its not.

Alex

JW Player Support Agent  
0 rated :

Hi, there.

I do not believe there is a way to play two ads in a row with our JavaScript API, as .playAd() can only be called in the following situations:

  • inside a JW Player event handler for onBeforePlay(), to trigger a pre-roll.
  • inside a JW Player event handler for onTime(), to trigger a mid-roll.
  • inside a event handler for onBeforeComplete(), to trigger a post-roll.
  • Outside of event handlers, only when the player is in the playing state.

Please let me know if you need any more help or have any other questions.

Thank you!

naortor

User  
0 rated :

Hey,

Thanks for your response,

Is there a way to configure 2 ads in a row on the setup phase?

like :

schedule: {
preroll1: {
offset: 'pre',
tag: 'http://adserver.com/vastResponse1.xml'
},
prerol2l: {
offset: 'pre',
tag: 'http://adserver.com/vastResponse1.xml'
},
}

Alex

JW Player Support Agent  
0 rated :

Hi, there.

If your ad tags are VAST 3.0-compliant, then you can use Ad Pods to accomplish this. You can read more about it on this support article. If you are using VAST 2.0 tags, there is no built-in way in our player to enable two ads in a row.

Please let me know if you need any more help or have any other questions.

Thank you!

This question has received the maximum number of answers.