Reputation: 6039
Is there a way to show/hide the video controls on the videojs player at runtime (e.g. player.controls.hide()).
Any ideas how to do this?
Thanks!
Upvotes: 7
Views: 16865
Reputation: 3028
this.player.controls(true) // shows control
this.player.controls(false) // hides control
Upvotes: 4
Reputation: 23554
Use player.userActive(false)
to hide the controls. You can also listen to useractive
and userinactive
events on the player to respond to the player's natural showing and hiding of controls.
Upvotes: 7
Reputation: 1977
This is how I hide controls after a 1 second mouse inactivity timeout.
var inactivityTimeout = null;
$('#vmr_video').mousemove(function(event) {
player.controlBar.fadeIn();
if (inactivityTimeout != null) {
clearTimeout(inactivityTimeout);
}
inactivityTimeout = setTimeout(function(){
player.controlBar.fadeOut();
controlBarVisible = false;
}, 1000);
});
Upvotes: 6