Search code examples
androidchromecastgoogle-castsrtwebvtt

Googlecast support for srt files


I am developing an application for playing videos with chromecast support. I have a trouble with subtitles. I can display .vtt subtitles, but there is a problem with classic .srt subtitle files. Does chromecast support subtitles in srt format? I found this link: Supported Media for Google Cast.

There is no explicit statement in this page, that chromecast does not support it. For example, Plex application can display them.

I use this piece of code:

MediaTrack subtitles = new MediaTrack.Builder(1, MediaTrack.TYPE_TEXT)
    .setName("Subtitles")
    .setSubtype(MediaTrack.SUBTYPE_SUBTITLES)
    .setContentId("http://some-example.srt")
    .setLanguage("en-US").build();

and

mRemoteMediaPlayer.setActiveMediaTracks(mApiClient, new long[] {1});

It works for vtt file, but for srt not.


Solution

  • The link you reference clearly states that only TTML, WebVTT and CEA-608 subtitle formats are supported by chromecast. Apps such as Plex are free to convert other formats into the supported formats or even render the other formats themselves in their own receivers.