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

This adds touch and move listeners to the parent of volumeBar. #2638

Closed
wants to merge 5 commits into from

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Sep 25, 2015

This is useful because it allows us to more easily be able to interact with the volume bar. Instead of just being able to click or touch on the 4 pixel high bar, we can click or touch on the whole height of the container where the bar is located in.

@pam
Copy link

pam commented Sep 25, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: e29c47cb485c87560448212268526dc2636f943e
Build details: https://travis-ci.org/pam/video.js/builds/82188478

(Please note that this is a fully automated comment.)

@@ -22,6 +22,7 @@ class VolumeBar extends Slider {
super(player, options);
this.on(player, 'volumechange', this.updateARIAAttributes);
player.ready(Fn.bind(this, this.updateARIAAttributes));
player.ready(() => this.on(this.el().parentNode, ['mousedown', 'touchdown'], this.handleMouseDown));
Copy link
Member

Choose a reason for hiding this comment

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

Can we assume that this is safe for anything that parentNode could be, assuming that volume bar could be used independently of the volume menu?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure. I could also move that into the volume menu button instead. And it's not quite safe as it is because some tests are failing because of this.
Either way, this is not a blocker for 5.0.

Copy link
Member

Choose a reason for hiding this comment

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

@gkatsev sounds like we should move it into the parent component.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll move it to the volume menu button.

This is useful because it allows us to more easily be able to interact with the volume bar. Instead of just being able to click or touch on the 4 pixel high bar, we can click or touch on the whole height of the container where the bar is located in.
@dmlap
Copy link
Member

dmlap commented Dec 14, 2015

LGTM, though we'll have to be careful that we never allow volume menu buttons to be created without an associated volume bar.

@gkatsev
Copy link
Member Author

gkatsev commented Dec 14, 2015

It gets created inside of createMenu which is also where the other methods are referenced in. So, unless someone overrides createMenu, we shouldn't have a problem. Though, even in that case, it might be ok because then the other methods won't get called.

@gkatsev
Copy link
Member Author

gkatsev commented Dec 14, 2015

I guess I should wrap them in if (this.volumeBar) just in case, maybe?

we show the volumeBar on focus for keyboard accessibility
when using the mouse, you don't want it to stay up, so, we blur it manually
// we show the volumeBar on focus for keyboard accessibility
// when using the mouse, you don't want it to stay up, so, we blur it manually
this.on('mouseout', function() {
this.el().blur();
Copy link
Member

Choose a reason for hiding this comment

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

mouseout could occur if they're using keyboard navigation but they also run their mouse over the volume bar.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that may be ok. Or at least, something that we would need to live with.
Unless we want to (if we are even able to) know whether we entered into this via a keyboard or mouse and then only blur on mouseout if we entered with the mouse.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'm going to remove this and open a new issue for this to get a proper fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened a new issue: #2918

@gkatsev gkatsev mentioned this pull request Dec 15, 2015
5 tasks
@dmlap
Copy link
Member

dmlap commented Dec 15, 2015

LGTM

@gkatsev gkatsev added the patch This PR can be added to a patch release. label Dec 15, 2015
@gkatsev gkatsev closed this in c61e9e4 Dec 15, 2015
@gkatsev gkatsev deleted the volume-control-bar-parent branch December 15, 2015 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch This PR can be added to a patch release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants