
Caption File Existance
will this be possible to check if caption file exist or not in server by calling ajax call to the file.
if file returns successfully then show the cc button and play the caption file and if file returns 404 error then hide the caption button from the player.
here is my code but i don't know how to create a ajax request for this.
<script type ="text/javascript">
jwplayer("myElement").setup({
playlist: [{
file: "jwplayer-7.2.2/MUNA.mp4",
image:"images.jpg",
titile: "My file",
displaytitle: true,
startparam: 'start',
//do{
//primary: "flash",
//label: "720p HD",
//stretching: "exactfit",
//controls: true,
//events:{
// onPlay: function(event) {
// alert('Playing!');
// }
// },
tracks: [{
file: "jwplayer-7.2.2/MUNAA.vtt",
label: "English",
kind: "captions",
"default": false
}]
//}
}],
captions: {
color: '#FF33F9',
fontSize: 24,
backgroundOpacity: 20
}
});
jwplayer().on('volume', function(e) {
alert("Volume is changed to: "+ e.volume);
});
jwplayer("myElement").on('captionsChange', function(e1) {
alert("play-during: "+ e1.getCaptionsList());
});