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

Advertising playAd function


Hi,

I got into situation in my code that i can't use your built-in ad schedule so i used the playAd function exactly in the way you recommended in your api reference.

I see that in the playAd the behavior of how it play the tag different from the built-in ad schedule.
On the build-in if i give it a tag it was waiting with loading until the tag was response (sync) with answer even if it's error or ad view.
In the playAd it's not waiting more than 500ms (async) so what happend is that the video start to play and when the VAST return answer it's play the ad.

Are you aware to this? Is this consider as bug in your side? Is there any fix for it?

Thanks.

8 Community Answers

Todd

JW Player Support Agent  
0 rated :

I would not expect the video to start to play before the ad if you are calling playAd() in an onBeforePlay() call.

How and where are you calling playAd() ? What kind of ad tag are you passing to playAd() ? Can you include your code example and ad tag here?

niv

User  
0 rated :

This is the both tags i'm using:

Tag1:
http://player.vcloud.it.best-tv.com/proi_direct/bxgpsjpfjcwcj5yyhtocttq6en3kshoj/script/vast2-vpaid?secure_vast=EAAAANwQ6N4LmkskH228YwCaTLD1l8pIkg%2b1rOhH9mEgL775tSxj9RWQm7leBf2aVrLnG51Jpzn0%2bRfGtbeOjIBH%2foaOEBgn%2bCodCPpowVdYop9xGJu8CvNM1Hak%2ft%2bepi3QJreKdntCFcsfx88O2dzjIYmBFKIFFDLONye51N7JFrCEKYtxkSl%2fDb7w7lQ39gCp5xCnhzKPcmYA5qU1xNdQG9yslEZKCSB6%2fo6%2fRHD%2ffbCe&page_url=__page-url__&video_url=&title=&description=&cb=__random-number__

Tag2:
http://search.spotxchange.com/vast/2.00/116919?VPAID=1&content_page_url=__page-url__&cb=__random-number__&player_width=__player-width__&player_height=__player-height__

I'm setting a flash jwplayer with flv video than i use the onBeforePlay which inside i call the playAd with one of the tag i paste you above.

Thanks.

niv

User  
0 rated :

Hi,

Did you got the chance to check my tags to see if you getting the same problem like me?

I was dig little bit more and i saw that this problem is happened only when you use VAST-VPAID, when you was only VAST it's behave ok.

I will be glad to here the result of your test.

Thanks.

Todd

JW Player Support Agent  
0 rated :

Yes, I am able to reproduce this bug. I have an FLV video, the player in Flash mode, and a SpotX test ad. The video is playing for ~1 second before the ad begins.

I’ll be sure to escalate this to our engineering team and report back to you with their comments.

niv

User  
2 rated :

Hi,

Just wanted to update you that i found for this bug a temporary solution.

Instead of call playAd() immediately in onBeforePlay() i call it with delay of 100 ms and it's solved this.

Thanks.

Todd

JW Player Support Agent  
0 rated :

Thanks for the update. I’ve verified this works on my reproduction page as well.

It’s strange to me that a delay of 100 ms actually makes the pre-roll ad play sooner, but I’m sure this will help our engineers determine the cause of this.

niv

User  
0 rated :

First i would like to say thank you for your support.

I have one more update that maybe will help your engineers.

I found yesterday that this bug is also happens when you try to playAd() as mid-roll by using the onTime() function and also when you try to playAd() as post-roll by using the onBeforeComplete() function.

Thanks.

Todd

JW Player Support Agent  
0 rated :

Hmm. I am not able to reproduce this for a midroll or postroll ad. They are firing as expected for me with the following code:

var midOnce = false; jwplayer(“test”).onTime(function(){

if (midOnce == false && jwplayer().getPosition() >= 5) {
console.log(‘Starting mid-roll at ’+jwplayer().getPosition());
jwplayer(“test”).playAd(’http://ad4.liverail.com/?LR_PUBLISHER_ID=1331&LR_SCHEMA=vast2-vpaid’);
midOnce = true;
}
});
var postOnce = false;
jwplayer(“test”).onBeforeComplete(function(){
if (postOnce == false) {
console.log(‘Starting post-roll at ’+jwplayer().getPosition());
jwplayer(“test”).playAd(’http://ad4.liverail.com/?LR_PUBLISHER_ID=1331&LR_SCHEMA=vast2-vpaid’);
postOnce = true;
}
});

This question has received the maximum number of answers.