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

Calling function of controlbar events


Is there a way to call a function when the controlbar idlehides ? I see there are ways to control the show or hide and I tried using the on('idle') but that seems to be at the end of the video.

1 Community Answers

Todd

JW Player Support Agent  
0 rated :

No, we do not have a built-in function that fires when the control bar changes state but there is a way to detect this using the player’s CSS classes:

jwplayer().on('time',function(){
	if (document.getElementsByClassName('jw-flag-user-inactive').length != 0) {
		console.log("Control bar is hidden");
	} else {
		console.log("Control bar is visible");
	}
});

This question has received the maximum number of answers.