i am using JWplayer for my videos
my player design will be hiding jwplayer control bar having my own control and than below the video i need to have caption not over the video so that view of the video is not hidden.
using inspect element i got the caption ID and CLASS (my-video_div_caption/jwcaptions) If i try to somehow read the caption using jquery to listen to changes within a div and act accordingly (like Listen to changes within a DIV and act accordingly)
than it is only reflected in HTML5 not in flash
if override the css it is only reflected in HTML5 not flash (show subtitle outside of player)
Now if i use the JWplayer api (which will help functionality to work in both HTML5 and flash)
function getCurrentCaptions1() {
$("#Caption_track").html("The current captions track is: " + jwplayer().getCurrentCaptions());
};
function getCaptionsList1() {
var levels = jwplayer().getCaptionsList();
var text = "The list of captions tracks is: ";
if(levels) {
for (var i=0; i < levels.length; i++) {
text += levels[i].label +", ";
}
} else { text += "- "; }
appendLog(text.substr(0,text.length-2));
};
function setCurrentCaptions1() {
var level = prompt("Set the captions track","1");
if(level != undefined) {
jwplayer().setCurrentCaptions(level);
}
};
jwplayer().onCaptionsList(function captionsList(event) {
console.log(event);
var text = "List of captions tracks changed to: ";
for (var i=0; i < event.tracks.length; i++) {
text += event.tracks[i].label +", ";
}
appendLog(text.substr(0,text.length-2));
});
jwplayer().onCaptionsChange(function captionsChange(event) {
appendLog("Current captions track changed to: "+event.track);
});
function appendLog(text) {
var log = document.getElementById("log");
var inner = log.innerHTML;
log.innerHTML = inner + text + "<br/>";
};
Using Above Code i can only find below stuff 1. current captions track 2. list of captions tracks 3.Set the current captions track
but my requirement is to have the caption in my own division below the video (if possible in my own division ) in both HTML5 and flash
help me in this , i can not understand how to do it using javascript API of JWplayer. or using jquery or using java script or using anything .....
Thank you for help Really appreciate all the genius of stack overflow ...thank you all
i am just beginner here but i am loving it thanks guys :)
Best -Hitesh
P.S. ( previously i asked one question which i didnt get answer till now how to Create webvtt file for subtitle dynamically if it is possible pls answer that question as well ...thanks :) )