Use Mac's hardware media keys to control media
Categories
(Core :: Audio/Video: Playback, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
Details
Attachments
(5 files)
In order to control media directly from the mac's hardware media keys (play/pause, seek, next), we have to intercept those key events from system and do corresponding operations.
Assignee | ||
Comment 1•5 years ago
|
||
In order to receive platform level media hardward keys event, we create a MediaHardwareKeysEventSource
which is used to implement intercepting those events according to different platforms.
We can add a MediaHardwareKeysEventListener
onto MediaHardwareKeysEventSource
, so that we can get notification whenever hardware media keys are being pressed.
MediaHardwareKeysManager
is used to encapsulate all these details, it would create a source and corresponding listener.
Assignee | ||
Comment 2•5 years ago
|
||
On OSX, we would use the CG event tap to intercept media keys event.
Assignee | ||
Comment 3•5 years ago
|
||
The ideal situation for media control should be incooperated with the audio competition so that we only have to control one controller.
However, if it's multiple controllers at the same time, we would tend to only control the last one in order to reduce confustion.
Ex. If we pause controller A first, and then start controller B. So what should we do when we press play/pause
hardware key?
To resume controller A or to stop controller B, or do both things at the same time?
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Comment 7•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/239c106912ab
https://hg.mozilla.org/mozilla-central/rev/a417c89cf52b
https://hg.mozilla.org/mozilla-central/rev/deb0bc2ec44f
https://hg.mozilla.org/mozilla-central/rev/49618c346430
https://hg.mozilla.org/mozilla-central/rev/fa579e9b1e7d
Description
•