Hy!
I would like to create an application which supports TTML typed closed captions.
My ism/manifest file contains the TTML based closed caption, I would like to ask how can I use it?
I found this site, https://developers.google.com/cast/docs/player where they described the following:
Segmented TTML & WebVTT
Use Segmented TTML for Smooth Streaming and WebVTT - Web Video Text Tracks for HLS.
To enable:
protocol_.enableStream(streamIndex, true); player_.enableCaptions(true);
But I can't find an example for my problem. Do I have to enable this after creating my host at the receiver side? Are there any sample app for this?
UPDATE #1
Here's my code:
window.onload = function() {
var mediaElement = document.getElementById('video'); //video is a html video tag
var mediamanager = new cast.receiver.MediaManager(mediaElement);
var url = "http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest"; //Just a sample URL
var host = new cast.player.api.Host({ 'mediaElement': mediaElement, 'url': url });
window.player = new cast.player.api.Player(host);
protocol = cast.player.api.CreateSmoothStreamingProtocol(host);
var initStart = 0;
window.player.load(protocol, initStart);
mediamanager.loadedmetadata = function(loadinfo) {
//onMetadataLoaded fired, set the caption
}
}
It doesn't work. So I decided to get the streams:
var streamCount = protocol.getStreamCount();
And streamCount contains 0. The manifest contains the closed caption, should I use something else, not the getStreamCount()?
Thank you very much!