1

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 :) )

Community
  • 1
  • 1
Hitesh
  • 4,098
  • 11
  • 44
  • 82
  • I'm currently working with jwPlayer and looking to do something similar within the next week. I'll try to keep your question in mind and hit this back up when I get to my solution. Good luck for now! – SpYk3HH May 17 '13 at 12:53
  • @SpYk3HH:Thanks :).... Are you from JWplayer developer team – Hitesh May 18 '13 at 04:09
  • Lol. No. Just picked it up. I just finished reskinning it and connecting it to a db. Its pretty fun! – SpYk3HH May 18 '13 at 05:48
  • hmmm nice @SpYk3HH .... thanks for trying it ... let me know if u got some idea – Hitesh May 19 '13 at 18:22
  • The captions being outside of the player is not something we can easily support. – emaxsaun May 28 '13 at 04:27
  • @EthanLongTail: i agree :( i am also struggling for long time :( – Hitesh May 28 '13 at 07:24
  • Yes, but this isn't isn't a common request, so we don't have a high demand to support this out of the box. – emaxsaun May 28 '13 at 07:38
  • I understand that not many ppl want this ... we dont want the caption to hide the tutorial video which has video content for user to learn that is why we want caption to be below the video -Hitesh – Hitesh May 30 '13 at 10:56
  • @SpYk3HH:hi there ....just wanted to know if you were able to bring the caption below or how far did u go ??? – Hitesh Jun 03 '13 at 10:23

0 Answers0