Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chapters-button): Remove dead code and fix selected capability. #3623

Closed
wants to merge 1 commit into from

Conversation

chemoish
Copy link
Member

Description

Fixes #3033, selectable with minimal code change. This doesn't account for any code style or implementation for leveraging ChaptersTrackMenuItem or extension of TextTrackMenuItem.

@@ -124,7 +98,8 @@ class ChaptersButton extends TextTrackButton {

const mi = new ChaptersTrackMenuItem(this.player_, {
cue,
track: chaptersTrack
track: chaptersTrack,
selectable: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@OwenEdwards OwenEdwards Sep 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "selectable" wasn't a clear way to describe this, but I don't think that chapters can be "selected". Think of selectable as being whether the item behaves like a checkbox or radio button - would you want it "checked" in the menu? For captions and descriptions, yes, you would. For the captions settings menu, you wouldn't.

Having a chapter "selected" only makes sense if you have a mechanism which updates the "selected" chapter as the video plays; otherwise it would be like leaving a checkmark on the progress bar of where you last clicked, even when playback has moved forward from that point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They actually are supposed to get updated as mentioned in #3472 and #3447.

Copy link
Member

@OwenEdwards OwenEdwards Sep 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then we need to discuss the concept of "selected" some more.

I can see that chapter menu items do update as "selected" based on the timeline, but from an ARIA perspective, it's not strictly "selected". Again, think of it as a checkbox - if a checkbox is already checked, and you click on it, you don't expect the checkbox to stay checked. If it's a radio button you do, but then you don't expect it to have another effect.

So this chapters menu is a hybrid control, which is both a user control and a progress display. I understand what @chemoish wants to achieve visually, but it's not doing the correct thing logically by just making chapter items "selectable". (Having said that, using the controlText to indicate selected as text to a screen reader was a hack too! Let's fix this properly before we go too far down the road to fix it at all).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a plan. We should either see if we can get #3472 updated since it has a bunch of other good fixes or merge in #3472 and then fix it forward in a separate PR before releasing.

* @return {Array} Array of menu items
* @method createItems
*/
createItems() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code never called. Item creation was all placed inside createMenu for some reason.

@chemoish
Copy link
Member Author

chemoish commented Sep 19, 2016

Partially, duplicative of #3472.

However, I think leveraging TextTrackMenuItem is probably better than forking implementation if possible.

@gkatsev, feel free to close.

@gkatsev
Copy link
Member

gkatsev commented Sep 20, 2016

Yeah, I think I'm going to close this now as this is available as part of #3472 as well, though, we still want more updates there. Please review that PR if you get the chance.

@gkatsev gkatsev closed this Sep 20, 2016
@gkatsev gkatsev mentioned this pull request Sep 23, 2016
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants