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

Control bar will not hide while playing ads


Hi,

I would like the player control bar to be hidden during ad playback and show it only if the user hovers or moves the cursor within the video container. It this possible during ad playback?

Thanks

1 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Sure, just use some JavaScript.

Sample code:

<div id="wrapper" style="width:580px;height:370px;"> <div id="my-video"></div> </div> <script type="text/javascript"> jwplayer("my-video").setup({ file: "http://content.bitsontherun.com/videos/i8oQD9zd-kNspJqnJ.mp4", image: "http://content.bitsontherun.com/thumbs/i8oQD9zd-640.jpg", width: "580", height: "370", primary: "flash", advertising: { client: "vast", schedule: { myAds: { offset: "pre", tag: "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" } } } }); jwplayer().onAdImpression(function() { jwplayer().setControls(false); }); jwplayer().onAdComplete(function() { jwplayer().setControls(true); }); document.getElementById('wrapper').onmouseover=function(){ if(jwplayer().getControls() == false){ jwplayer().setControls(true); } }; document.getElementById('wrapper').onmouseout=function(){ if(jwplayer().getControls() == true){ jwplayer().setControls(false); } }; </script>

Formatted – https://gist.github.com/emaxsaun/c1f817861bdcfdba9aa8

This question has received the maximum number of answers.