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

JWplayer7 - Hide controlbar when video ends (7.4.4)


I have a follow up question to this question/solution => https://support.jwplayer.com/customer/portal/questions/14598723-jwplayer7-hide-controlbar-when-video-ends

I updated the JWplayer from v7.2.4 to v7.4.4 and the above solution doesn't work anymore =(

Previous Javascript snippet:
playerInstance.on('complete',function(){
var thePlayer = document.querySelector(".jw-state-complete");
thePlayer.classList.remove("jw-state-complete");
thePlayer.classList.add("jw-state-idle");
});

On "complete" the classes are not being changed anymore. I would appreciate any help =)

3 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

Do you have a test page with your current setup? I’ll be able to make a better judgement as to what solution fits you best.

dk

User  
0 rated :

Hi George,

sure, here:
http://kithaitaa.com/jwplayer/jwplayer-7-2-4.php vs.
http://kithaitaa.com/jwplayer/jwplayer-7-4-4.php

As you can see, on the newer jw-player-version the jw-state-class (jw-state-complete) remains untouched, after the video ends (complete).

George

JW Player Support Agent  
0 rated :

Hey DK,

Try something along these lines perhaps:

function hideControlbar(){

document.styleSheets0.insertRule(“.jw-controlbar { display: none !important;}”, 0);
/* Longer Alternative
var sheet = document.createElement(‘style’)
sheet.innerHTML = “.jw-controlbar { display: none !important;}”;
document.body.appendChild(sheet);
*/
}

jwplayer().on(‘complete’,function(){

hideControlbar();
});

This question has received the maximum number of answers.