-1

I would like to be able to detect if the user is using adblocking software when they watch videos on jwplayer example

i want to tell users that the ad revenue is used for server bills maintenance and they should consider turning Adblock off. How can i implement this on jwplayer but not on whole site thanks in advance :)

John
  • 11
  • 1

2 Answers2

2

You can use on.('adBlock') from the Javascript API Reference:

.on('adBlock')(JW Player 7.3+) This event is fired when an ad plugin (Either VAST or Google IMA) is configured inside of the JW Player setup, and an ad blocker is detected on a viewer's browser. It is then possible to request a user disable their ad blocker to proceed.

https://support.jwplayer.com/customer/en/portal/articles/1413089-javascript-api-reference

Josie Keller
  • 477
  • 2
  • 8
0

You can use ad block event in jwplayer 7.3.4 release eg: playerInstance.on('adBlock',function(){ alert("Users please remove ad blocker"); playerInstance.load({file:"http://jwpsrv.a.ssl.fastly.net/content/conversions/zWLy8Jer/videos/7RtXk3vl-364766.mp4?token=0_56a0922a_0x893cf21425ca84ad3c1c86b144894943fcf9317f", image:"http://assets-jpcust.jwpsrv.com/thumbs/7RtXk3vl-480.jpg"});

ski
  • 45
  • 6