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

CC button default


Hi,

i made default: flase inside track object.

when first time i load the player then by default CC button come with disable feature but if i left CC button by making enable and again come to that page then CC button comes with ENABlE option.

but i want to always make this disable and when user click on this then it will be enable.

This is my code

tracks: [{

file:"http://s-k12resources.nelson.com/" +vttCaptionURL,
type: 'hls',
label: "English",
kind: "captions",
"default": false

}]

5 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

You’ll want to clear localStorage if you don’t want caption settings to be persisted:
http://qa.jwplayer.com.s3.amazonaws.com/~george/clear_local.html

Sudhir Ranjan Rout

User  
0 rated :

Hi George,

This code didnot work for me.

window.onload = function() {

clearData();
}
function clearData()
{
window.localStorage.clear();
}

George

JW Player Support Agent  
0 rated :

The code example uses onunload for the body tag

<head> <script> function blackout(){ window.localStorage.clear(); } </script></head> <body onunload="blackout()"> </body>

Sudhir Ranjan Rout

User  
0 rated :

Hi,

i want this function not in refresh mode rather i want this when user logout and again login so they will see the default mode.

also i use this onunload for body tag but didn't see any difference.

George

JW Player Support Agent  
0 rated :

Hello Sudhir,

We don’t offer custom development services, you’ll have to debug the setup on your own. The reason the caption setting remains on is because we save the state in LocalStorage. You’ll have to find the right time to clear LocalStorage.

This question has received the maximum number of answers.