Start listening media key event only when we have media controller
Categories
(Core :: Audio/Video: Playback, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
We found that some MediaControlKeysEventSource
have a need to request some kind of focus from platform, in order to retrigger the event listening.
Therefore, instead of letting the event source to handle this issue directly, we can let MediaControlKeysManager
to create an event source intelligently according to the MediaController
number.
If there is one more controller in the media service, which means we have to listen the media key event in order to control them, then we would create an event source. Otherwise, we don't need to have an event source because nothing needs to be controlled. So event source could be created or destroyed dynamically according to the controller's amount.
Assignee | ||
Comment 1•6 years ago
|
||
As we have a need to know if there is any existing controller needs to be controlled in order to achieve dynamically creation and destruction of media keys event source. (that will be implemented in patch2)
Therefore, using the media event to send the current media controller amount when the total media controller amount changed in the media service.
Assignee | ||
Comment 2•6 years ago
|
||
In this patch, we dynamically create or destroy media keys event source according to the media controller amount.
We would create the event source when we have a controller which needs to be controlled, and destory the event source when there is no controllers existing.
In addition, create a Init()
function for media service for calling any other owned module's initialization, which is used to ensure that we finish setting the gMediaControlService
before any other classes call MediaControlService::GetService()
.
Assignee | ||
Comment 3•6 years ago
|
||
The event source in MediaControlKeysManager
now is created dynamically, so that means sometime we don't have an event source to allow people add or remove listener.
Therefore, make MediaControlKeysManager
being a wrapper of MediaControlKeysEventSource
, it would manage all listeners and make sure add them to the real event source.
Updated•6 years ago
|
Assignee | ||
Comment 4•6 years ago
|
||
Make MediaControlKeysEventListener
and MediaControlKeysEventSource
being a pure interface, then we can allow an usage such like inheritting from both MediaControlKeysEventListener
and MediaControlKeysEventSource
at the same time, which doesn't be allowed in old implementation because we can only have one parent class owning mRefCnt
.
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 5•6 years ago
|
||
To make sure it never happens.
Assignee | ||
Comment 6•6 years ago
|
||
Updated•6 years ago
|
Comment 8•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d168bfd2524c
https://hg.mozilla.org/mozilla-central/rev/222533f6446e
https://hg.mozilla.org/mozilla-central/rev/9d1e133ed17c
https://hg.mozilla.org/mozilla-central/rev/103ad9fe9fea
https://hg.mozilla.org/mozilla-central/rev/55fe1b2e71c4
https://hg.mozilla.org/mozilla-central/rev/f0ceeb68fff9
Description
•