Closed Bug 1602617 Opened 2 months ago Closed 2 months ago

Reuse the same MediaControlKeysEventSource but use `open()` and `close()` to control monitoring media key events

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Because we won't change platform dynamically, so we should be able to keep same the event source all the time and use Open() and Close() to control if we need to monitor media keys event or not.

In theory, we could start to apply this to the Mac Event Source, by only enabling/disabling the tap in Open/Close and leave the init to the constructor (or do it in the first open call, then we can return a failure).

However I think we need to change the Mac Code in a further iteration anyway, as there is https://developer.apple.com/documentation/mediaplayer/becoming_a_now_playable_app, which seems to be the equivalent to the other two desktop APIs (Now Playing Info = Metadata, Remote Command Center Actions = Mediakeys?).

(In reply to Marc Streckfuß [:MeFisto94] from comment #3)

However I think we need to change the Mac Code in a further iteration anyway, as there is https://developer.apple.com/documentation/mediaplayer/becoming_a_now_playable_app, which seems to be the equivalent to the other two desktop APIs (Now Playing Info = Metadata, Remote Command Center Actions = Mediakeys?).

That will be implemented in bug 1591230, which will be landed soon.

Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f9eb0ac18a3b
part1 : add a method to check if the event source is opened. r=MeFisto94
https://hg.mozilla.org/integration/autoland/rev/1fb1ca98f23b
part2 : reuse same event source all the time. r=MeFisto94
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.