I want to update the SmoothStreaming chromecast player with a TTML captions URL in my receiver application. My manifest file does not contain this URL from the start, so I need to add it with:
cast.player.enableCaptions(true, 'ttml', subtitleUrl);
I do this right after the player starts and the meta data is loaded to the media element (as recommended in other post), but when looking at the
protocol.getStreamCount();
I only get two streams: one for video and one for audio. I see no sign of captions there. I have also tried to override the manifest info in the host object (which works well for the license url):
host.updateCaptionsRequestInfo = function (request){
requestInfo.url=subtitleUrl;
}
But this function is not called until i call the enableCaptions function (and only called if I add the third argument, at which point the third argument is unnecessary since it is overwritten by the updateCationsRequestInfo function).
Do anyone know how to check if the captions request is accepted or rejected somewhere, and how to handle this? It would be better to not use updateCationsRequestInfo() since I then can change subtitles during playback.
Can the issue be that the url doesnt look like a ttml link (it is another format passed through a converter)?
Thank you for the help!
Update concerning CORS:
I logged the ttml-url right before calling player.enableCaptions(), and if i follow the url, I get the ttml file (response headers: Content-Type: text/xml and some CORS-related headers). In google dev tools I cant see anything related to player.enableCaptions(), no errors or success messages. So it is not connected to CORS issues.