
Javascript API - beforePlay event not working properly
According to this doc:
https://support.jwplayer.com/customer/portal/articles/1413089-javascript-api-reference#advertising
.on('beforePlay')
Fired just before the player begins playing. Unlike the onPlay event, the player will not have begun playing or buffering when triggered, which makes this the right moment to insert preroll ads using playAd(). It has no event attributes.
'beforePlay' event should play a preroll ad.
Here is my test page: http://sandbox.ht.indexexchange.com/ht/webmirrors/ApartmentTherapy/www.apartmenttherapy.com/beforePlayIssue.html
It does play a preroll ad. But every time I pause the video and resume, the ad is also playing.
Could you tell me what goes wrong? How could I make the preroll ad work?
Thanks!
Jim