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 no subtitle on switching tracks #621

Merged
merged 2 commits into from
May 6, 2024

Conversation

mukulmishra18
Copy link
Contributor

Description

When switching between different subtitle track, sometime it does not show the subtitle cue anymore.

We are clearing subtitle label component on SubtitleEnabled and SubtitleDisabled. This should be added again on CueEnter event.

The event sequence coming from Player is sometime off. When enabling subtitle, the sequence of event looks like, SubtitleEnable, CueEnter and SubtitleEnabled. This makes the Label component added and removed again, causing no subtitle being shown.

We are now not removing the component on SubtitleEnabled but just on SubtitleDisabled. This should be enough as a previous subtitle is disabled when a new one is enabled.

Checklist (for PR submitter and reviewers)

  • CHANGELOG entry

@mukulmishra18 mukulmishra18 self-assigned this May 3, 2024
@mukulmishra18
Copy link
Contributor Author

Did some manual testing and the changes looks okay. The only thing I can see is that we are getting 2 CueEnter events when PlayerSubtitleAPI.enable is called with exclusive is false. Both of the cues are shown in the UI when second subtitle is enabled. This is also same with old implementation, we get 2 CueEnter events and those are shown in the UI.

@mukulmishra18 mukulmishra18 marked this pull request as ready for review May 3, 2024 09:16
Copy link
Contributor

@felix-hoc felix-hoc left a comment

Choose a reason for hiding this comment

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

makes sense 👍🏼

@felix-hoc felix-hoc merged commit f9d1ca5 into develop May 6, 2024
2 checks passed
@felix-hoc felix-hoc deleted the feature/fix-no-subtitle-on-switching-tracks branch May 6, 2024 12:37
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.

2 participants