VOOZH about

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1575995

⇱ 1575995 - Use Mac's hardware media keys to control media


Closed Bug 1575995 Opened 6 years ago Closed 6 years ago

Use Mac's hardware media keys to control media

Use Mac's hardware media keys to control media
Core
Audio/Video: Playback
unspecified
Unspecified
macOS
task
Points:
---
RESOLVED FIXED
RESOLVED
FIXED
mozilla71
Iteration:
---
a11y-review
Accessibility Severity
Performance Impact
Size Estimate
Webcompat Priority
Webcompat Score
Tracking Status
firefox71 --- fixed
Tracking Status
relnote-firefox
thunderbird_esr115
thunderbird_esr140
firefox-esr115
firefox-esr140
firefox-esr153
firefox71
firefox152
firefox153
firefox154
---
QA Whiteboard:
---
Has STR:
---
Change Request:
---
Bug Flags:
Signature:
None
This bug is publicly visible.

 
Assignee

Description

6 years ago

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

6 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

6 years ago

On OSX, we would use the CG event tap to intercept media keys event.

Assignee

Comment 3

6 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?

Comment 6

6 years ago
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/239c106912ab part1 : implement basic classes for handling media hardware keys. r=baku https://hg.mozilla.org/integration/autoland/rev/a417c89cf52b part2 : implement the event source on OSX. r=spohl https://hg.mozilla.org/integration/autoland/rev/deb0bc2ec44f part3 : implement play/pause controller. r=chunmin https://hg.mozilla.org/integration/autoland/rev/49618c346430 part4 : add the pref 'media.hardwaremediakeys.enabled' to control this feature. r=baku https://hg.mozilla.org/integration/autoland/rev/fa579e9b1e7d part5 : add gTests r=spohl
Regressions: 1594028
You need to log in before you can comment on or make changes to this bug.