Bug 214634 - REGRESSION: Fullscreen HTML5 video subtitles/captions are shown twice
Summary: REGRESSION: Fullscreen HTML5 video subtitles/captions are shown twice
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 13
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-22 03:12 PDT by Simon
Modified: 2021-02-01 21:19 PST (History)
15 users (show)

See Also:


Attachments
Patch (2.82 KB, patch)
2021-02-01 13:37 PST, Peng Liu
eric.carlson: review+
Details | Formatted Diff | Diff
Revise the patch based on Eric's comment (3.61 KB, patch)
2021-02-01 17:52 PST, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2020-07-22 03:12:11 PDT
When an HTML5 video is played with subtitles/captions in fullscreen, the previous subtitles will shown an additional time for a fraction of a second when the text is changed to the next one. The issue is a bit difficult to describe but you can take a look at the following examples to get a better understanding of the problem.

* Two examples that have the issue:
https://www.iandevlin.com/html5test/webvtt/html5-video-webvtt-sample.html
https://codepen.io/JediLin/full/jpzgpv

* How to recreate the bug:
Try one of these links and fullscreen the video and enable subtitles. 
The bug will occur on fullscreen but not on windowed/in-page mode.

I am using an 5th generation iPad with iOS version 13.6, Safari version 13.1
Comment 1 Radar WebKit Bug Importer 2020-07-23 17:43:28 PDT
<rdar://problem/66023355>
Comment 2 Peng Liu 2020-07-23 17:49:39 PDT
The issue is obvious with the first example video in my test.
Comment 3 Simon 2020-07-23 18:17:25 PDT
I can add that the issue did not occur on iOS 13.3.1 but does occur on iOS 13.6. And in iOS 13.4, Safari was updated from 13.0 to 13.1 which included some webkit updates: https://webkit.org/blog/10247/new-webkit-features-in-safari-13-1/
Comment 4 Robert Erneborg 2020-10-02 06:24:33 PDT
(In reply to Peng Liu from comment #2)
> The issue is obvious with the first example video in my test.

We are still affected by this. Is it likely that this issue will get picked up anytime soon?
Comment 5 Peng Liu 2021-01-23 19:52:13 PST
When I read the code, I noticed an issue that we set the "hidden" property of a text track representation layer to false before rendering the new subtitle. I will upload a patch to fix it.
Comment 6 Peng Liu 2021-02-01 13:37:10 PST
Created attachment 418917 [details]
Patch
Comment 7 Eric Carlson 2021-02-01 17:22:45 PST
Comment on attachment 418917 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418917&action=review

> Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp:302
> +    m_needsGenerateTextTrackRepresentation = true;

I know this isn't new to this change, but "m_needsToGenerateTextTrackRepresentation" would be a better name.
Comment 8 Peng Liu 2021-02-01 17:52:12 PST
Created attachment 418947 [details]
Revise the patch based on Eric's comment
Comment 9 Peng Liu 2021-02-01 17:52:37 PST
Comment on attachment 418917 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418917&action=review

>> Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp:302
>> +    m_needsGenerateTextTrackRepresentation = true;
> 
> I know this isn't new to this change, but "m_needsToGenerateTextTrackRepresentation" would be a better name.

Agree! fixed.
Comment 10 EWS 2021-02-01 21:18:59 PST
Committed r272190: <https://trac.webkit.org/changeset/272190>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418947 [details].