2

I don't want the caption to show on startup.

I added this:

tracks: [{
   file : 'subtitles/file.vtt', 
   kind: 'captions',
   "default" : false
}],
captions: {
   color: '#fff',
   fontSize: 20,
   backgroundColor: '#006666',
   kind: 'captions'
},

This doesn't work. I also tried without 'default': false (the default is off)

vhu
  • 12,244
  • 11
  • 38
  • 48
user2587454
  • 903
  • 1
  • 19
  • 44

1 Answers1

2

The "kind" parameter belongs in the tracks block, not in the captions block. Nevertheless, I have the same problem. Whether setting "default" to false or omitting the parameter, the captions are on when the player starts up. You can fix it by adding

playerInstance.setCurrentCaptions(0);

after the setup. In some of my configurations this prevented the player from obeying a pause command (by Javascript), so I had to do this:

var s = 0;
playerInstance.onPlay(function() {
    if(s==0){
    playerInstance.setCurrentCaptions(0);
    s=1;
   }
});

The s variable makes sure that the captions are not turned off on subsequent pause/play actions in case the user turns them on. I assume you are using jwplayer version 7. My captions are .srt, by the way.

hiviking
  • 21
  • 3