Commit bdf1fc5
fix: Text tracks with src= on Safari & UITextDisplayer are sometimes 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 <ladvan91@hotmail.com>1 parent b08c64b commit bdf1fc5
1 file changed
+22
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3092 | 3092 | | |
3093 | 3093 | | |
3094 | 3094 | | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
3095 | 3107 | | |
3096 | 3108 | | |
3097 | 3109 | | |
3098 | 3110 | | |
3099 | 3111 | | |
3100 | 3112 | | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
3101 | 3120 | | |
3102 | 3121 | | |
3103 | | - | |
3104 | | - | |
3105 | 3122 | | |
3106 | | - | |
3107 | | - | |
3108 | | - | |
3109 | | - | |
3110 | | - | |
3111 | | - | |
3112 | | - | |
3113 | | - | |
3114 | | - | |
3115 | | - | |
3116 | | - | |
3117 | | - | |
3118 | | - | |
| 3123 | + | |
| 3124 | + | |
3119 | 3125 | | |
3120 | 3126 | | |
3121 | 3127 | | |
3122 | 3128 | | |
3123 | | - | |
3124 | | - | |
3125 | | - | |
3126 | | - | |
3127 | | - | |
3128 | | - | |
3129 | | - | |
| 3129 | + | |
3130 | 3130 | | |
3131 | 3131 | | |
3132 | 3132 | | |
| |||
0 commit comments