Closed Bug 1620899 Opened 5 years ago Closed 4 years ago

Arrow keys don't work in picture-in-picture window after tabbing unless play/pause is pressed

Categories

(Toolkit :: Video/Audio Controls, defect, P3)

defect

Tracking

()

VERIFIED FIXED
83 Branch
Accessibility Severity s3
Tracking Status
firefox83 --- verified

People

(Reporter: Jamie, Assigned: reidshina6, NeedInfo)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(2 files)

STR:

  1. Open https://www.youtube.com/watch?v=dQw4w9WgXcQ
  2. Start playing (and enjoying) the video.
  3. Press control+shift+] to switch to picture-in-picture. The picture-in-picture window gets focus.
  4. Press right arrow to fast forward.
    • Observe: It works. Yay!
  5. Press tab.
  6. Press right arrow to fast forward.
    • Observe: It doesn't work.
  7. Tab a few more times to get back to the pause button.
  8. Press right arrow to fast forward.
    • Expected: It should fast forward.
    • Actual: Nothing happens.
  9. Press space to pause the video.
  10. Press space again to play.
  11. Press right arrow.
    • Observe: It works. Yay!

Not supporting this when not focused on the play/pause button (step 6) is okay, though I'm not sure if this restriction is really necessary and it could make life easier if it weren't thus restricted. That said, we obviously can't support the space shortcut in this case, since that would break expected activation of the other buttons when they're focused.
However, the real problem here is that even after returning to the play/pause button, the arrow keys don't work. Aside from being annoying, it can leave users with the impression (as it did initially for me) that the keyboard shortcuts don't work at all (or not reliably), since a user won't necessarily think to try pressing play/pause before using them.

Hey gl, do you have time to look at this? I guess we should probably only be opting to redirect space / return when focusing moves to another button in the player, but the rest of the keyboard shortcuts should get sent down to the underlying video.

Blocks: videopip
Flags: needinfo?(gl)
Priority: -- → P3

(In reply to Mike Conley (:mconley) (:⚙️) from comment #1)

Hey gl, do you have time to look at this? I guess we should probably only be opting to redirect space / return when focusing moves to another button in the player, but the rest of the keyboard shortcuts should get sent down to the underlying video.

Hey Mike, I will assign myself and take a look when I get a cycle.

Assignee: nobody → gl
Status: NEW → ASSIGNED
Flags: needinfo?(gl)
See Also: → 1546954

Updating the Accessibility Team's impact assessment to conform with the new triage guidelines. See https://wiki.mozilla.org/Accessibility/Triage for descriptions of these whiteboard flags.

Whiteboard: [access-p2] → [access-s3]

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3
Assignee: gl → nobody
Status: ASSIGNED → NEW
Assignee: nobody → reidshina6

Hey Reid,

By default, the keyboard shortcuts for seeking the video are disabled. You'll need to enable them first. Type about:config in the URL bar, press enter, click past the warning, then search for this preference:

media.videocontrols.picture-in-picture.keyboard-controls.enabled

and toggle it to true to turn on the keyboard controls.

Here is the handler for the keydown event for the PiP player window: https://searchfox.org/mozilla-central/rev/8f97d6d022bd18d4c3138bf5f13f4144ac334d82/toolkit/components/pictureinpicture/content/player.js#199-221

I think the logic here needs to be updated: https://searchfox.org/mozilla-central/rev/8f97d6d022bd18d4c3138bf5f13f4144ac334d82/toolkit/components/pictureinpicture/content/player.js#211-213

Let me explain what we're doing here. We've got two modes of keyboard interaction:

  1. Tabbing around to the different buttons in the UI. This is named "keying" mode, for some reason.
  2. Keyboard shortcuts that have nothing to do with the buttons, that are proxied down to the underlying <video> (for example, seeking)

The condition in the code that I highlighted above tries to make it so that we don't send commands down to the underlying <video> when we're in "keying" mode. I think we're being too restrictive here - we only want to avoid sending down those keyboard commands in "keying" mode if they were the spacebar. Others (like cursors) are okay to go through.

As part of this patch, I think it'd also be really prudent to add some keyboard shortcut tests. We don't have a lot of coverage for the keyboard shortcuts in the player window. Let's get the problem fixed, and then I'll guide you on how to write a test for it (and the rest of the keyboard shortcuts).

```

Hey Reid,

Can you try doing ./mach build (instead of ./mach build faster), and see if that helps?

Flags: needinfo?(reidshina6)
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/45929f0dbda0 Arrow keys don't work in picture-in-picture window after tabbing unless play/pause is pressed. r=mconley,Gijs
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

Reproduced the initial issue using an old Nightly build 75.0a1 on Windows 10.
Verified - Fixed in latest Nightly 84.0a1 84.0a1 (2020-10-22) and Beta 83.0b3 (build id: 20201022171613).

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Accessibility Severity: --- → s3
Whiteboard: [access-s3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: