Bug 211230 - Media controls tracks menu shows "Auto" selected instead of track selected via the JS API
Summary: Media controls tracks menu shows "Auto" selected instead of track selected vi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-30 06:17 PDT by Antoine Quint
Modified: 2020-06-01 12:58 PDT (History)
10 users (show)

See Also:


Attachments
Test (291 bytes, text/html)
2020-04-30 06:17 PDT, Antoine Quint
no flags Details
Patch (10.45 KB, patch)
2020-05-01 13:20 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2020-04-30 06:17:41 PDT
Created attachment 398051 [details]
Test

(this is a report from a problem originally reported by aashraya on the WebKit Slack at https://webkit.slack.com/archives/CU5LWFM28/p1588225198051000)

Consider this simple test (also attached):

<body>
    <video autoplay controls src="https://storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8" style="width: 800px"></video>
    <script>
        document.querySelector('video').addEventListener("play", e => e.target.textTracks[2].mode = "showing");
    </script>
</body>

When the video starts playing the French caption is on, which is as expected. However, when showing the captions menu, the "Auto" item is selected.

Debugging a bit in the media controls code, the problem is that when `TextTracksSupport.tracksPanelIsTrackInSectionSelected()` is called to populate individual rows under the "Subtitles" menu, the MediaControlsHost has its `captionDisplayMode` property set to `automatic`. As such, I think the media controls code is doing what is expected and there is a problem in the media engine reporting the wrong value through MediaControlsHost.
Comment 1 Radar WebKit Bug Importer 2020-04-30 06:18:02 PDT
<rdar://problem/62648409>
Comment 2 Antoine Quint 2020-04-30 06:21:26 PDT
It's also possible we're interpreting the value of captionDisplayMode incorrectly and that this value being set to "true" shouldn't override an individual text track as showing selected.
Comment 3 Antoine Quint 2020-04-30 06:21:42 PDT
Haven't had the chance to see if this regressed.
Comment 4 Antoine Quint 2020-05-01 13:20:03 PDT
Created attachment 398226 [details]
Patch
Comment 5 Eric Carlson 2020-05-04 08:20:17 PDT
Comment on attachment 398226 [details]
Patch

Thanks you!
Comment 6 EWS 2020-05-04 08:28:51 PDT
Committed r261084: <https://trac.webkit.org/changeset/261084>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398226 [details].
Comment 7 Oren Me 2020-05-29 11:12:16 PDT
Happy you were able to fix this issue, I reported this more than a year ago https://bugs.webkit.org/show_bug.cgi?id=195046 as this kept coming from users and was especially annoying with inline playback feature where users started inline, used html rendered controls and selected language(this is the change via JS api) and then when moving to fullscreen which is the native iOS player then the tracks UI there was not updated to reflect the change
Comment 8 Antoine Quint 2020-05-29 11:14:15 PDT
(In reply to Oren Me from comment #7)
> Happy you were able to fix this issue, I reported this more than a year ago
> https://bugs.webkit.org/show_bug.cgi?id=195046 as this kept coming from
> users and was especially annoying with inline playback feature where users
> started inline, used html rendered controls and selected language(this is
> the change via JS api) and then when moving to fullscreen which is the
> native iOS player then the tracks UI there was not updated to reflect the
> change

Hi Oren. I wasn't aware of this bug. Hopefully the fix for this bug fixes the one you reported.
Comment 9 Oren Me 2020-06-01 12:58:52 PDT
Thanks, surely sounds like the same so hope it does.
When will it be available for testing?