-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: Text tracks with src= on Safari & UITextDisplayer are sometimes rendered natively #8256
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Incremental code coverage: 94.12% |
avelad
approved these changes
Mar 19, 2025
tykus160
approved these changes
Mar 19, 2025
avelad
added a commit
that referenced
this pull request
Mar 19, 2025
…rendered natively (#8256) This concerns `src=` mode. Safari loads text tracks separately, where on `loadeddata`, we might not have `video.textTracks` set to its final value (as Safari could still be processing another text track underneath). This PR introduces an artificial wait on the `addtrack` and assumes, if no other track is added within the next 500ms, textTracks shall be in its final state. Issues when we work with `textTracks` too early: - When we set mode of a textTrack to `hidden` (we'd do that to allow UiTextDisplayer to render text tracks), Safari might overwrite this decision (based on `AUTOSELECT=YES`) when a subsequent text track is parsed. This leaves us in an invalid state where textTracks are rendered natively but we have listeners bound to the wrong one. More info here: #8255 - It could be no textTracks are available at all on `loadeddata` due to Safari internally defering the load for text tracks. This would break preferences. --------- Co-authored-by: Álvaro Velad Galván <[email protected]>
avelad
added a commit
that referenced
this pull request
Mar 19, 2025
…rendered natively (#8256) This concerns `src=` mode. Safari loads text tracks separately, where on `loadeddata`, we might not have `video.textTracks` set to its final value (as Safari could still be processing another text track underneath). This PR introduces an artificial wait on the `addtrack` and assumes, if no other track is added within the next 500ms, textTracks shall be in its final state. Issues when we work with `textTracks` too early: - When we set mode of a textTrack to `hidden` (we'd do that to allow UiTextDisplayer to render text tracks), Safari might overwrite this decision (based on `AUTOSELECT=YES`) when a subsequent text track is parsed. This leaves us in an invalid state where textTracks are rendered natively but we have listeners bound to the wrong one. More info here: #8255 - It could be no textTracks are available at all on `loadeddata` due to Safari internally defering the load for text tracks. This would break preferences. --------- Co-authored-by: Álvaro Velad Galván <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
browser: Safari
Issues affecting Safari or WebKit derivatives
priority: P2
Smaller impact or easy workaround
type: bug
Something isn't working correctly
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This concerns
src=
mode. Safari loads text tracks separately, where onloadeddata
, we might not havevideo.textTracks
set to its final value (as Safari could still be processing another text track underneath).This PR introduces an artificial wait on the
addtrack
and assumes, if no other track is added within the next 500ms, textTracks shall be in its final state.Issues when we work with
textTracks
too early:hidden
(we'd do that to allow UiTextDisplayer to render text tracks), Safari might overwrite this decision (based onAUTOSELECT=YES
) when a subsequent text track is parsed. This leaves us in an invalid state where textTracks are rendered natively but we have listeners bound to the wrong one. More info here: Text tracks with src= on Safari & UITextDisplayer are sometimes rendered natively. #8255loadeddata
due to Safari internally defering the load for text tracks. This would break preferences.