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

Subtitle in Media3 not syncing properly with audio/video on ui #2050

Open
amit12kumardish opened this issue Jan 17, 2025 · 2 comments
Open

Comments

@amit12kumardish
Copy link

amit12kumardish commented Jan 17, 2025

override fun onTracksChanged(tracks: Tracks) {
                    super.onTracksChanged(tracks)
                    for (group in tracks.groups) {
                        for (i in 0 until group.length) {
                            val format = group.getTrackFormat(i)
                            if (format.sampleMimeType == MimeTypes.APPLICATION_CEA608 || format.sampleMimeType == MimeTypes.APPLICATION_CEA708) {
                             Timber.d("onTracksChanged: %s", format.sampleMimeType)
                             val override = TrackSelectionOverride(group.mediaTrackGroup, i)
                             player?.let { player ->
                                 val parameters =
                                       player.trackSelectionParameters
                                      .buildUpon()
                                      .addOverride(override)
                                      .build()
                                  player.trackSelectionParameters = parameters
                                     }
                                }
                            }
                        }
                    }

i am able to see the tracks, but sometimes captions are not matching with audio.video, its lagging

@icbaker
Copy link
Collaborator

icbaker commented Jan 17, 2025

Please provide media we can use to reproduce the issue. Please either upload it here or send it to [email protected] with the subject Issue #2050. Please also update this issue to indicate you’ve done this.

@icbaker icbaker self-assigned this Jan 17, 2025
@amit12kumardish
Copy link
Author

amit12kumardish commented Jan 17, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants