How to streaming subtitle in moon.Video

Hi all,
i want to use subtitle in moon.Video, but must be download subtitle file to TV local and then set track attribute to show,
how to streaming subtitle file not downloading,

another question: how to get temporary directory path in webOS SmartTV by enyojs?

Thank you very much.

Comments

  • I played with subtitles a little at the weekend. This is what worked for me:

    rendered: function () {
    this.inherited(arguments);
    var video=this.$.player.getVideo().node;
    var track = document.createElement("track");
    track.srclang="en";
    track.label="English subtitle";
    track.src="http://192.168.64.5/test/sample.vtt";
    video.appendChild(track);
    t=video.textTracks[0];
    t.mode="showing";
    }

    It looks like WebOS only supports webvtt subtitles, not srt. So I had to edit (insert WEBVTT text into the first line) or convert my srt file to display it.
  • I forgot to mention that normally to add track like this, you need the track file from the same origin as your document. So testing from a file doesn't work without disabling web-security in Chrome/Chromium. Or just run your document from a web server. It looks like it's not a problem in WebOS.
  • Thanks @IRO , can i using subtitle moon.Video in webOS TV?
  • I tried it with moon.VideoPlayer on a WebOS 2 TV.
    Only webvtt format works, you need to edit or convert to webvtt.
    One drawback is, that if there are internal subtitles in the file, the first is displayed also.
    I haven't tried media fragments yet.
  • edited March 2016
    @IRO, moon.VideoPlayer can playsub in browser, but cannot streaming subtitle in webOSTV, i must be download subtitle file, have you any idea that can streaming subtitle in webOS TV?
    many thanks.
  • If your code is working fine in a browser, but not on WebOS, maybe you can try debugging on the TV.
    Here are the instructions how to do it:
    http://developer.lge.com/webOSTV/sdk/web-sdk/webos-tv-cli/debugging-web-applications-cli

    Or try to paste your code here, maybe someone spot an error.
Sign In or Register to comment.