Bug 1602841 - Implement keystroke handling for PiP window for video controls. r=mconley
commitaa684c0c76136be80af4c6e429bce81dea55c429
authorGabriel Luong <gabriel.luong@gmail.com>
Sun, 26 Jan 2020 06:21:23 +0000 (26 06:21 +0000)
committerGabriel Luong <gabriel.luong@gmail.com>
Sun, 26 Jan 2020 06:21:23 +0000 (26 06:21 +0000)
tree010181852ec206c50ad30e919e61ee492cf574de
parentfb42ac6003d3b96f768d016b3d9d78f56f6a5878
Bug 1602841 - Implement keystroke handling for PiP window for video controls. r=mconley

This implements keystroke handling behind a pref "media.videocontrols.picture-in-picture.keyboard-controls.enabled".
This patch handles all the keystrokes for video controls, which include play, pause,
volume decrease and increase, mute, unmute, seek forward and backward for 15 seconds
or by 10% of the max video duration, seek to beginning and seek to end.
This reuses the key handler logic from https://searchfox.org/mozilla-central/rev/cfd1cc461f1efe0d66c2fdc17c024a203d5a2fd8/toolkit/content/widgets/videocontrols.js#1687-1810.

Differential Revision: https://phabricator.services.mozilla.com/D60631

--HG--
extra : moz-landing-system : lando
browser/app/profile/firefox.js
toolkit/actors/PictureInPictureChild.jsm
toolkit/components/pictureinpicture/content/player.js