问题
I have successfully cast video to chromecast now I am trying to add support for subtitles, here I am facing two problems
- When I stream vtt files using NanoHttpd chromecast returns error code 2100, although I am streaming videos using same server and it works
- To figure out problem I uploaded the vtt file to dropbox and now chromecast returns success also setting mediatracks returns success but subtitles are not shown.
Note : I am using Chromecast default media receiver
So what I am doing wrong?
回答1:
If I recall correctly, your server needs to provide CORS support for Closed Captions, even if you are simply streaming mp4 media files, so make sure that happens when using your embedded server. Once that is done, make sure you are setting the "active tracks" correctly. If at that point you have an issue, you'd need to provide more information: your code around adding and activating tracks, your receiver log (for which you'd need either a Styled or custom receiver).
来源:https://stackoverflow.com/questions/36951929/chromecast-subtitle