Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed to add the Subtitles to cast using #8875

Closed
drayan85 opened this issue Apr 27, 2021 · 2 comments
Closed

Help needed to add the Subtitles to cast using #8875

drayan85 opened this issue Apr 27, 2021 · 2 comments
Assignees
Labels

Comments

@drayan85
Copy link

MediaMetadata.Builder builder = new MediaMetadata.Builder().setTitle("Video Title");
List <MediaItem.Subtitle> subtitleList = new ArrayList<>(); 
MediaItem.Subtitle subtitle = new MediaItem.Subtitle(subtitleUri, MimeTypes.APPLICATION_SUBRIP, "en", C.SELECTION_FLAG_DEFAULT);
subtitleList.add(subtitle);
MediaItem.Builder mMediaItemBuilder = new MediaItem.Builder()
                .setUri(videoSourceUri)
                .setMediaMetadata(builder.build())
                .setSubtitles(subtitleList)
                .setMimeType(mimeType);
castPlayer.setMediaItem(mMediaItemBuilder.build(), resumePosition);

This is not displaying the selected subtitle on Chrome Cast
PS : Local ExoPlayer with new style player control working as expected
Cast Demo app is not updated and cast demo don't include subtitle implementation

@icbaker
Copy link
Collaborator

icbaker commented Apr 27, 2021

I think this is a duplicate of #8669, specifically this comment from @marcbaechinger discusses adding support for subtitle tracks in DefaultMediaItemConverter.

@marcbaechinger
Copy link
Contributor

Yes, @icbaker is right that this is currently not supported and is tracked with #8669 that is marked as an enhancement. I updated the title of the other issue to clarify this.

We don't have an ETA for this right now but you can inject your own MediaItemConverter into CastPlayer to do that conversion yourself.

Please add you rcomments regarding this to #8669. I'm closing this as a duplicate. Please re-open if you think we need to continue here.

@google google locked and limited conversation to collaborators Jun 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants