kakone / GoogleCast

Implementation of the Google Cast protocol (.NET Standard 2.0 library)
GNU General Public License v3.0
141 stars 22 forks source link

How to set subtitles? #8

Closed ghost closed 6 years ago

ghost commented 6 years ago

I set the SubTitle property of the Metadata info of the media but subtitles never show.

        var media = new Media
        {
            ContentId = isRemote ? MediaPath : mediaPath,
            ContentType = "video/mp4",
            Metadata = new MovieMetadata
            {
                Title = MediaName,
                SubTitle = !string.IsNullOrEmpty(subtitle) ? subtitle : null
            }
        };

subtitle variable is http://192.168.1.11/Subtitles%2Ftt3606752%2FCars%203%20NEW%20HD-TS%20x264-CPG.vtt (URI encoded to my local server which serves .vtt static files with CORS, as required by Chromecast https://developers.google.com/cast/docs/media.

There is no Track property to the loaded media, which is the required way to load subtitles as explained https://developers.google.com/cast/docs/chrome_sender_advanced

kakone commented 6 years ago

I'm sorry, I did not have time to look at this problem. In fact, the "SubTitle" property is not to indicate a file of closed captions but to indicate a complement of the title. I will try to add this feature as soon as possible.

kakone commented 6 years ago

Fixed by 886ccad9874d329f5a90ed551fb0a9f948b4c0a4. You can download the 1.4 version. I will add the TextTrackStyle class to configure the subtitles appareance later.