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

fix(ios): keep subtitle selection on foreground #3707

Conversation

Myst1024
Copy link
Contributor

Summary

  • When playing an m3u8 file with embedded subtitle tracks, the user's subtitle selections are wiped out whenever the player is foregrounded. This PR prevents that scenario

Motivation

  • Users were losing subtitle settings when the app was minimized/the screen was turned off, then the app was foregrounded again.

Changes

  • Only update selectedTextTrack if there is a value being passed in selectedTextTrackCriteria

Test plan

  • On IOS, Play an m3u8 file that includes embedded subtitle tracks such as the sintel with subtitles example
  • Choose one of the embedded subtitle tracks
  • Minimize the app or turn off the screen
  • Foreground the app or turn the screen back on
  • The previously selected subtitles should continue to display when the video resumes

@KrzysztofMoch KrzysztofMoch changed the title fix:ios losing subtitle selection on foreground fix(ios): keep subtitle selection on foreground Apr 25, 2024
@KrzysztofMoch KrzysztofMoch self-requested a review April 25, 2024 09:34
Copy link
Member

@KrzysztofMoch KrzysztofMoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍, but should we do same for audioTrack?

@freeboub
Copy link
Collaborator

Your patch doesn't look problematic, but I am disturbed as I don't reproduce the issue ... do you have specific props to get the issue ? (maybe you use controls ?)

@Myst1024
Copy link
Contributor Author

Your patch doesn't look problematic, but I am disturbed as I don't reproduce the issue ... do you have specific props to get the issue ? (maybe you use controls ?)

I have controls={true} and playWhenInactive={true} which I could see contributing to this.
Using version 6.0.0-rc.0

@freeboub freeboub merged commit bee4123 into TheWidlarzGroup:master Sep 5, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants