
Closed Caption with VTT or SRT not working
Hi,
I am trying to add a simple closed caption with VTT or SRT files. The player loads and the video plays just fine and also shows CC button enabled but my VTT file is not read and the CC text are not displaying.
What am I missing?
here is my code:
<head>
<title></title>
<script src="/jwplayer/jwplayer.js"></script>
<script>jwplayer.key = "XXXXXXXXXXXXi1RXlWpLd8NXXXX==";</script>
</head>
<body>
<div id="myElement">Loading the player...</div>
<script type="text/javascript">
jwplayer('myElement').setup({
primary: 'flash',
playlist: [{
sources: [{
file: 'samplevideo.mp4',
}],
title: "Sample Movie Trailer",
tracks: [{
file: "engilishcaption.srt",
label: "English",
kind: "captions",
"default": true
},
{
file: "frenchcaption.vtt",
kind: "captions",
label: "French"
}]
}]
});
jwplayer('myElement').setCurrentCaptions(1);
</script>
</body>
</html>