
jwAdvancedSetup
Is there a way to hide custom buttons (created with the addButton API call) until the user mouses over the video area or until the use clicks the play button? I'm trying to give the custom buttons the same show/hide proporties as the control bar i nthat the control bar doesn't show until the user clicks the play button. My code is:
// Add playback speed buttons in JW plyer iframe
var trident = !!navigator.userAgent.match(/Trident\/7.0/);
var net = !!navigator.userAgent.match(/.NET4.0E/);
var IE11 = trident && net
var IEold = ( navigator.userAgent.match(/MSIE/i) ? true : false );
var theVideo;
jwplayer().onReady(function(){
theVideo = document.querySelector('video');
theVideo.defaultPlaybackRate = 1.0;
theVideo.playbackRate = 1.0;
if (jwplayer().getRenderingMode() == "flash"){
return;
}
playerInstance.addButton(
"imagehere","tooltiphere",
function() {
if(IE11 || IEold){
jwplayer().seek(jwplayer().getPosition());
jwplayer().onSeek(function(){theVideo.playbackRate = 1.0;});
jwplayer().onPause(function(){theVideo.playbackRate = 1.0;});
jwplayer().onPlay(function(){theVideo.playbackRate = 1.0;});
theVideo.playbackRate = 1.0;
} else {
jwplayer().seek(jwplayer().getPosition());
theVideo.playbackRate = 1.0;
}
},
"1X"
);