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: focus play toggle from Big Play Btn on play #4018

Merged
merged 2 commits into from Feb 3, 2017
Merged

fix: focus play toggle from Big Play Btn on play #4018

merged 2 commits into from Feb 3, 2017

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Feb 1, 2017

If the control bar and playtoggle exist, focus the playtoggle after
triggering play via the keyboard from the Big Play Button.
If play() returns a promise, wait until it resolves to focus,
otherwise, use a setTimeout.

Fixes #2729

If the control bar and playtoggle exist, focus the playtoggle after
triggering play via the keyboard from the Big Play Button.
If `play()` returns a promise, wait until it resolves to focus,
otherwise, use a setTimeout.

Fixes #2729
@gkatsev gkatsev added the a11y This item might affect the accessibility of the player label Feb 1, 2017
const playToggle = cb && cb.getChild('playToggle');

if (!playToggle) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

If there isn't a playToggle control, focus ought to move to either the player's <div>, or the <video> element, rather than just falling into a black hole! I guess the <video> element won't be there if the player uses a Flash tech, so the <div> makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can focus on the tech.

Copy link
Member

Choose a reason for hiding this comment

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

Strictly, focus ought to move to something which is actionable, but it can move to something which isn't if pressing Tab from there will get the user to an actionable control (rather than, for example, the next focusable element after the video.js player)

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, I'll just focus the player element and we can always tweak it in the future if we think there's something better.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to focus on the player element in this case.

Copy link
Member

@OwenEdwards OwenEdwards left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

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

LGTM

@gkatsev gkatsev merged commit 4f79e1e into master Feb 3, 2017
@gkatsev gkatsev deleted the bpb-focus branch February 3, 2017 21:30
@richardbushell
Copy link
Contributor

@gkatsev
As per #4039, could this be included in latest 5.x release too please...

gkatsev added a commit that referenced this pull request Feb 23, 2017
If the control bar and playtoggle exist, focus the playtoggle after
triggering play via the keyboard from the Big Play Button.
If the control bar isn't available, then focus the player element.
If play() returns a promise, wait until it resolves to focus,
otherwise, use a setTimeout.

Fixes #2729
@gkatsev
Copy link
Member Author

gkatsev commented Feb 23, 2017

@OwenEdwards @richardbushell ported over in #4132

@richardbushell
Copy link
Contributor

@gkatsev Terrific, thanks...

gkatsev added a commit that referenced this pull request Feb 27, 2017
If the control bar and playtoggle exist, focus the playtoggle after
triggering play via the keyboard from the Big Play Button.
If the control bar isn't available, then focus the player element.
Adds focus() and blur() on components.

This is a port of #4018.

Fixes #2729 for the 5.x branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y This item might affect the accessibility of the player
Projects
None yet
4 participants