KeyboardEvent.ctrlKey prevents Audio Autoplay unlock? (also other modifier keys)
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: github, Unassigned)
Details
Attachments
(1 file)
427 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
Consider a simple, keyboard controlled audio player: an <audio>
element, some JS to listen on keydown
and trigger .play()
.
Since the keydown is user interaction (like a click), this should get around Autoplay blocking, and start playback.
Actual results:
It works as long as I don't use modifier keys: event.key === '#'
works, but event.key === '#' && event.ctrlKey
does not -- the Block Audio icon pops up in the URL bar. Only happens on https (and file://), not on http.
See attached file to reproduce, or this pen. Note: serve the html via https. In the pen, you might need to right-click & "open frame in new window". Avoid extra clicks since they unlock audio (I think).
Press Space or # to play -- this should start playback;
press Ctrl+Space or Alt+# -- Blocked Audio icon should appear, no playback.
Expected results:
I'd expect keydown events to unlock Audio, regardless of modifier keys.
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Description
•