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

adComplete not fires on beforeComplete


I want to fire, when a postroll-ad was viewed until the end.

My Code:

jwplayer("player").on('beforeComplete', function(e){
jwplayer("player").playAd('http://vast-url...');
});

jwplayer("player").on('adComplete', function(e){
console.debug("ad complete");
});

the "adComplete" never fires. on prerolls (beforeStart) and midrolls (onTime) the event fires.

Is it a bug?

3 Community Answers

Randy

JW Player Support Agent  
0 rated :

Hello,

I believe you might be missing the advertising: {} parameter which tells the player what type of ad it is loading. I’ve included an example below:

var playerInstance = jwplayer(‘myElement’);playerInstance.setup({file: ‘bunny.mp4’,advertising: {client: “vast”,}});
playerInstance.on(‘beforeComplete’, function(){playerInstance.playAd(‘http://www.adotube.com/php/services/player/OMLService.php?avpid=oRYYzvQ&platform_version=vast20&ad_type=linear&groupbypass=1&HTTP_REFERER=http://www.longtailvideo.com&video_identifier=longtailvideo.com,test’); console.debug(“adPlayed”);
});

Randy

melanie N/A

User  
0 rated :

Hi Randy,

i don't had the advertising-tag, but i had the preroll through the jw üplayer library. I have there a vast-code and i think that the advertising-tag was added by the library.

I add the tag manualy and my code looks like this:

<script type="text/javascript" src="http://content.jwplatform.com/libraries/28pnXXXXX.js"></script>


<script type="text/javascript">
jwplayer("player").setup({
file: "http....",
image: 'http...',
title: "My Title",
androidhls: true,
advertising:{client: "vast"}
});
</script>

Nothing changed. The adcomplete event is not there when i use playAd in the onBeforecomplete.

melanie

User  
0 rated :

Hi Randy,

any News?

This question has received the maximum number of answers.