Chromcast instream subtitles are not working

162 views Asked by At

I am trying to play video with multiple instream subtitles on Chromecast custom receiver application, but it not working. Here is the code that I use for enabling subtitles stream:

mediaElement.addEventListener('playing', function(e) {
  setStreamLanguage('text', 'fin');
  player.enableCaptions(true);
});

function setStreamLanguage(streamType, languageCode){
            var streamInfo;
            var streamToEnable = -1;

            for(var i = 0; i < protocol.getStreamCount(); ++i) {
                streamInfo = protocol.getStreamInfo(i);

                if (streamInfo.mimeType.indexOf(streamType) == 0) {
                    // select first stream by default in case there are no passed stream
                    if (streamToEnable < 0)
                        streamToEnable = i;

                    // disable all stream
                    protocol.enableStream(i, false);

                    // find a stream to enable
                    if (streamInfo.language == languageCode)
                        streamToEnable = i;

                    console.log('cycling throught: ' + streamInfo.mimeType + " " + streamInfo.language + " " +
                                "is selected: " + protocol.isStreamEnabled(i));
                }
            }

            if (streamToEnable >= 0)
            {
                protocol.enableStream(streamToEnable, true);
                console.log("stream " + streamToEnable + " is enabled now");
            }
        }

As a result video is being played, but no subtitles are displayed. Also there is an error in console: "Uncaught URIError: URI malformed".

Here is the manifest, used for test: http://usp.neonstingray.com/video/13440/13440.ism/Manifest.

Here is chromecast receiver logs: https://gist.github.com/anonymous/e992c306602fb3cb5b8a

0

There are 0 answers