Commit 306b682
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 b2a1d35 commit 306b682
1 file changed
+22
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3197 | 3197 | | |
3198 | 3198 | | |
3199 | 3199 | | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
3200 | 3212 | | |
3201 | 3213 | | |
3202 | 3214 | | |
3203 | 3215 | | |
3204 | 3216 | | |
3205 | 3217 | | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
3206 | 3225 | | |
3207 | 3226 | | |
3208 | | - | |
3209 | | - | |
3210 | 3227 | | |
3211 | | - | |
3212 | | - | |
3213 | | - | |
3214 | | - | |
3215 | | - | |
3216 | | - | |
3217 | | - | |
3218 | | - | |
3219 | | - | |
3220 | | - | |
3221 | | - | |
3222 | | - | |
3223 | | - | |
| 3228 | + | |
| 3229 | + | |
3224 | 3230 | | |
3225 | 3231 | | |
3226 | 3232 | | |
3227 | 3233 | | |
3228 | | - | |
3229 | | - | |
3230 | | - | |
3231 | | - | |
3232 | | - | |
3233 | | - | |
3234 | | - | |
| 3234 | + | |
3235 | 3235 | | |
3236 | 3236 | | |
3237 | 3237 | | |
| |||
0 commit comments