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

How can I set a subtitle and audio in castplayer #11287

Closed
sajjadshahbazi opened this issue Sep 11, 2023 · 1 comment
Closed

How can I set a subtitle and audio in castplayer #11287

sajjadshahbazi opened this issue Sep 11, 2023 · 1 comment
Assignees

Comments

@sajjadshahbazi
Copy link

sajjadshahbazi commented Sep 11, 2023

Bug

I want to set a subtitle and audio in the CastPlayer, but I Can't.

for subtitle, I Set :

 val mediaItem = MediaItem.Builder()
            .setUri(Uri.parse(videoUrl))
            .setMimeType(mediaType)
            .setMediaMetadata(movieMetadata)
            .setTag(videoUrl)
            .setSubtitleConfigurations(
                listOf(MediaItem.SubtitleConfiguration.Builder(Uri.parse(subtitleUrl)).build())
            ).build()

for the subtitle, it didn't work.
After that I used this: #8669 (comment)
First I converted from MediaItem to MediaQueueItem, and when I was making MediaQueueItem I Set Subtitle MediaTracks, After making the MediaQueueItem, I Converted the MediaQueueItem to MediaItem, and then I set the MediaItem to CastPlayer. but after preparing CastPlayer, I can't find Subtitle Tracks.

@icbaker
Copy link
Collaborator

icbaker commented Sep 11, 2023

The com.google.android.exoplayer2 project is now deprecated. We are not accepting any new issues in this project. Please file your issue in the androidx.media3 GitHub project instead: https://github.com/androidx/media/issues

@icbaker icbaker closed this as completed Sep 11, 2023
@google google locked and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants