Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Issue 1082533002: Support text track selection in video controls (Closed)

Created:
5 years, 8 months ago by srivats
Modified:
4 years, 8 months ago
Reviewers:
philipj_slow, fs
CC:
blink-reviews, ed+blinkwatch_opera.com, blink-reviews-rendering, nessy, zoltan1, eae+blinkwatch, blink-reviews-css, philipj_slow, gasubic, fs, eric.carlson_apple.com, leviw+renderwatch, Dominik Röttsches, feature-media-reviews_chromium.org, dglazkov+blink, blink-reviews-html_chromium.org, apavlov+blink_chromium.org, pdr+renderingwatchlist_chromium.org, jchaffraix+rendering, darktears, vcarbune.chromium, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Support text track selection in video controls Enable the user to select between text tracks with a menu that is displayed when the CC button is clicked. Chromium-side CL: https://codereview.chromium.org/1079323002/ BUG=353105 TEST=run-webkit-tests media*

Patch Set 1 #

Total comments: 88

Patch Set 2 : Addressed comments from fs #

Total comments: 8

Patch Set 3 : Removed container and addressed comments from fs #

Total comments: 10

Patch Set 4 : Handled multiple showing tracks and addressed comments from fs #

Patch Set 5 : Rebase #

Total comments: 68
Unified diffs Side-by-side diffs Delta from patch set Stats (+651 lines, -243 lines) Patch
M LayoutTests/media/media-controls.js View 1 2 3 2 chunks +46 lines, -7 lines 0 comments Download
M LayoutTests/media/track/cue-style-invalidation.html View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/media/track/cue-style-invalidation-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/media/track/text-track-selection-menu-add-track.html View 1 chunk +50 lines, -0 lines 0 comments Download
A LayoutTests/media/track/text-track-selection-menu-add-track-expected.txt View 1 chunk +21 lines, -0 lines 0 comments Download
A LayoutTests/media/track/text-track-selection-menu-multiple-tracks.html View 1 chunk +47 lines, -0 lines 0 comments Download
A LayoutTests/media/track/text-track-selection-menu-multiple-tracks-expected.txt View 1 chunk +37 lines, -0 lines 0 comments Download
M LayoutTests/media/video-controls-captions.html View 4 chunks +13 lines, -13 lines 0 comments Download
M LayoutTests/media/video-controls-captions-expected.txt View 2 chunks +3 lines, -3 lines 0 comments Download
D LayoutTests/media/video-controls-captions-load-by-lang.html View 1 chunk +0 lines, -50 lines 0 comments Download
D LayoutTests/media/video-controls-captions-load-by-lang-expected.txt View 1 chunk +0 lines, -19 lines 0 comments Download
D LayoutTests/media/video-controls-captions-multiple-clicks.html View 1 chunk +0 lines, -86 lines 0 comments Download
D LayoutTests/media/video-controls-captions-multiple-clicks-expected.txt View 1 chunk +0 lines, -36 lines 0 comments Download
A + LayoutTests/media/video-controls-captions-on-off.html View 4 chunks +18 lines, -19 lines 0 comments Download
A + LayoutTests/media/video-controls-captions-on-off-expected.txt View 2 chunks +4 lines, -4 lines 0 comments Download
A LayoutTests/media/video-controls-track-selection-menu.html View 1 1 chunk +47 lines, -0 lines 0 comments Download
A LayoutTests/media/video-controls-track-selection-menu-expected.txt View 1 1 chunk +26 lines, -0 lines 0 comments Download
A LayoutTests/platform/linux/media/video-controls-track-selection-menu-expected.png View Binary file 0 comments Download
M Source/core/css/CSSPrimitiveValueMappings.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/css/CSSSelector.cpp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/css/CSSValueKeywords.in View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/mediaControls.css View 1 2 3 1 chunk +73 lines, -0 lines 18 comments Download
M Source/core/html/HTMLMediaElement.h View 1 2 3 4 2 chunks +2 lines, -0 lines 3 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 3 chunks +9 lines, -0 lines 0 comments Download
M Source/core/html/shadow/MediaControlElementTypes.h View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/html/shadow/MediaControlElementTypes.cpp View 1 2 1 chunk +6 lines, -0 lines 3 comments Download
M Source/core/html/shadow/MediaControlElements.h View 1 2 2 chunks +24 lines, -0 lines 0 comments Download
M Source/core/html/shadow/MediaControlElements.cpp View 1 2 3 4 4 chunks +151 lines, -3 lines 38 comments Download
M Source/core/html/shadow/MediaControls.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/html/shadow/MediaControls.cpp View 1 2 3 4 chunks +20 lines, -0 lines 2 comments Download
M Source/core/html/track/TextTrack.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/track/TextTrack.cpp View 1 2 1 chunk +8 lines, -0 lines 4 comments Download
M Source/core/layout/LayoutMediaControls.cpp View 1 2 2 chunks +13 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutTheme.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/layout/LayoutTheme.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/layout/LayoutThemeDefault.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/layout/LayoutThemeDefault.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/platform/ThemeTypes.h View 1 chunk +2 lines, -1 line 0 comments Download
M public/blink_image_resources.grd View 1 chunk +1 line, -0 lines 0 comments Download
A public/default_100_percent/blink/mediaplayer_trackselection_checkmark.png View Binary file 0 comments Download
M public/platform/WebLocalizedString.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (2 generated)
srivats
Hi Philip, I've added the text track selection menu to Blink. PTAL. FYI I encountered ...
5 years, 8 months ago (2015-04-11 00:59:34 UTC) #2
fs
Some comments while you're waiting for philipj. https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css File Source/core/css/mediaControls.css (right): https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css#newcode334 Source/core/css/mediaControls.css:334: -webkit-appearance: media-closed-captions-track-list-container; ...
5 years, 8 months ago (2015-04-14 12:34:57 UTC) #4
srivats
https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css File Source/core/css/mediaControls.css (right): https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css#newcode334 Source/core/css/mediaControls.css:334: -webkit-appearance: media-closed-captions-track-list-container; On 2015/04/14 12:34:55, fs wrote: > I ...
5 years, 8 months ago (2015-04-16 23:37:20 UTC) #5
fs
https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css File Source/core/css/mediaControls.css (right): https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css#newcode377 Source/core/css/mediaControls.css:377: text-align: left; On 2015/04/16 23:37:19, srivats wrote: > On ...
5 years, 8 months ago (2015-04-17 11:54:46 UTC) #6
fs
https://codereview.chromium.org/1082533002/diff/20001/Source/core/html/HTMLMediaElement.h File Source/core/html/HTMLMediaElement.h (right): https://codereview.chromium.org/1082533002/diff/20001/Source/core/html/HTMLMediaElement.h#newcode213 Source/core/html/HTMLMediaElement.h:213: void setAutomaticTextTrackSelection(bool); On 2015/04/17 11:54:46, fs wrote: > This ...
5 years, 8 months ago (2015-04-17 12:06:25 UTC) #7
srivats
https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css File Source/core/css/mediaControls.css (right): https://codereview.chromium.org/1082533002/diff/1/Source/core/css/mediaControls.css#newcode377 Source/core/css/mediaControls.css:377: text-align: left; On 2015/04/17 11:54:46, fs wrote: > On ...
5 years, 8 months ago (2015-04-21 01:48:56 UTC) #8
fs
Starting to look pretty ok, let's try to summon philipj. https://codereview.chromium.org/1082533002/diff/1/Source/core/html/shadow/MediaControlElements.cpp File Source/core/html/shadow/MediaControlElements.cpp (right): https://codereview.chromium.org/1082533002/diff/1/Source/core/html/shadow/MediaControlElements.cpp#newcode489 ...
5 years, 8 months ago (2015-04-21 12:13:34 UTC) #9
srivats
https://codereview.chromium.org/1082533002/diff/1/Source/core/html/shadow/MediaControlElements.cpp File Source/core/html/shadow/MediaControlElements.cpp (right): https://codereview.chromium.org/1082533002/diff/1/Source/core/html/shadow/MediaControlElements.cpp#newcode489 Source/core/html/shadow/MediaControlElements.cpp:489: tracksHeader->appendChild(doc->createTextNode(mediaElement().locale().queryString(WebLocalizedString::TextTracksSubtitlesCC))); On 2015/04/21 12:13:34, fs wrote: > On 2015/04/21 ...
5 years, 8 months ago (2015-04-21 21:11:18 UTC) #10
srivats
Hey Philip, Can you take a look?
5 years, 8 months ago (2015-04-27 23:49:25 UTC) #11
philipj_slow
This reviewed looked big a time-consuming, so I put it off for a while after ...
5 years, 7 months ago (2015-05-05 14:36:57 UTC) #12
fs
https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaControls.css File Source/core/css/mediaControls.css (right): https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaControls.css#newcode355 Source/core/css/mediaControls.css:355: max-height: 250px; On 2015/05/05 14:36:56, philipj_UTC2 wrote: > This ...
5 years, 7 months ago (2015-05-05 15:32:44 UTC) #13
philipj_slow
https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaControls.css File Source/core/css/mediaControls.css (right): https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaControls.css#newcode355 Source/core/css/mediaControls.css:355: max-height: 250px; On 2015/05/05 15:32:44, fs wrote: > On ...
5 years, 7 months ago (2015-05-06 09:28:43 UTC) #14
srivats
On 2015/05/06 09:28:43, philipj wrote: > https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaControls.css > File Source/core/css/mediaControls.css (right): > > https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaControls.css#newcode355 > ...
5 years, 6 months ago (2015-06-03 22:30:40 UTC) #15
srivats
I've responded to the comments here. I had to merge this code review with https://codereview.chromium.org/1079323002/ ...
4 years, 10 months ago (2016-02-23 01:39:27 UTC) #16
philipj_slow
4 years, 9 months ago (2016-03-01 11:21:04 UTC) #17
https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaCo...
File Source/core/css/mediaControls.css (right):

https://codereview.chromium.org/1082533002/diff/80001/Source/core/css/mediaCo...
Source/core/css/mediaControls.css:395: top: -2px;
On 2016/02/23 01:39:26, srivats wrote:
> On 2015/05/05 14:36:56, philipj wrote:
> > What's this for? Is the image element misaligned (vertical-align:middle not
> > working) or is this compensating for the PNG itself not having the checkmark
> > where it should?
> 
> It looks misaligned without the -2px. Might be an issue with the PNG but I
tried
> using a different one and it still looked off.

Following up in other CL.

https://codereview.chromium.org/1082533002/diff/80001/Source/core/html/shadow...
File Source/core/html/shadow/MediaControlElementTypes.cpp (right):

https://codereview.chromium.org/1082533002/diff/80001/Source/core/html/shadow...
Source/core/html/shadow/MediaControlElementTypes.cpp:92: bool
MediaControlElement::isVisible()
On 2016/02/23 01:39:26, srivats wrote:
> On 2015/05/05 14:36:56, philipj wrote:
> > I've been meaning to change hide() and show() to use the hidden attribute
> > instead, partly because of the rumor that this is a stronger signal that
> > display:none that it should be ignored by screen readers. Can you name this
> > isHidden() instead so that it would make sense if that change is made? (It
> also
> > avoids the impression that this could have to do with the visibility
> attribute.)
> 
> Done.

Well this changed again since last, sorry about that. (See other CL.)

https://codereview.chromium.org/1082533002/diff/80001/Source/core/html/shadow...
File Source/core/html/shadow/MediaControlElements.cpp (right):

https://codereview.chromium.org/1082533002/diff/80001/Source/core/html/shadow...
Source/core/html/shadow/MediaControlElements.cpp:401:
showTextTrackAtIndex(trackIndex);
On 2016/02/23 01:39:27, srivats wrote:
> On 2015/05/05 14:36:56, philipj_UTC7 wrote:
> > What happens if the text tracks change while this menu is showing? It looks
> like
> > the wrong track will be enabled?
> 
> I tested this out by removing a track using the console while the menu was
open
> and clicking on the track just removed, the next track on the list got
enabled.
> This does seem inconvenient, but the other option would be to refresh the menu
> when this happens. Would you recommend that?

Refreshing the menu also seems wrong, maybe the user isn't even interested in
that specific track and yet the UI jumps around. I think the best one could hope
for is a behavior equivalent to what happens with a text track with a broken
URL, which is that one can click it, the other tracks are disabled, but then
nothing happens. However, that seems like a bit of overkill, I suggest waiting
until it's a real problem.

https://codereview.chromium.org/1082533002/diff/80001/Source/core/html/shadow...
Source/core/html/shadow/MediaControlElements.cpp:442: // When the track kind is
captions, add a captions marker to distinguish between captions and subtitles.
On 2016/02/23 01:39:27, srivats wrote:
> On 2015/05/05 15:32:44, fs wrote:
> > On 2015/05/05 14:36:57, philipj_UTC2 wrote:
> > > I'm not sure this will make sense in all languages, as a Swedish user I
> > wouldn't
> > > know what [CC] means, at least. I'd probably realize that it has to do
with
> > > subtitles because the button says so, but that it's the difference between
> > > subtitles and captions (for hard-of-hearing) is not obvious. I don't have
a
> > good
> > > suggestion here, but think we need to involve some UI people in this.
> > 
> > Since it is localized, it could well be "" for Swedish, "(HoH)" for en-GB
etc.
> 
> UX suggested I use icons here to differentiate between the two track kinds

And I really like that new subtitles icon!

https://codereview.chromium.org/1082533002/diff/80001/Source/core/html/track/...
File Source/core/html/track/TextTrack.cpp (right):

https://codereview.chromium.org/1082533002/diff/80001/Source/core/html/track/...
Source/core/html/track/TextTrack.cpp:463: // A track can be displayed when it's
of kind captions or subtitles and hasn't failed to load
On 2016/02/23 01:39:27, srivats wrote:
> On 2015/05/05 15:32:44, fs wrote:
> > On 2015/05/05 14:36:57, philipj_UTC2 wrote:
> > > I guess this means that if the readinessState is NotLoaded and one tries
to
> > > enable the track, the next time one opens the menu that track will simply
be
> > > gone?
> > 
> > Yes. Optionally I suppose one could "gray it out" or similar (it's pretty
> > annoying with things you can interact with but which doesn't do anything...)
> UI
> > issue really though.
> Should we just exclude the NotLoaded tracks from being displayed?

I think what you have now in the other CL seems to work well. We can't exclude
NotLoaded tracks, because that could be all of them!

Powered by Google App Engine
This is Rietveld 408576698