Dispatch devicechange events even without an actively capturing MediaStreamTrack
Categories
(Core :: WebRTC: Audio/Video, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: karlt, Assigned: karlt)
References
Details
Attachments
(8 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
+++ This bug was initially created as a clone of Bug #1732409 +++
Gecko currently dispatches "devicechange" events only when
- there is an actively capturing MediaStreamTrack, or
- the origin has a permission for permanent access to a camera or microphone.
"fully active and has focus" has subsequently been added to the spec as a sufficient condition. This provides for "audiooutput" devices even when getUserMedia()
is not used.
The permissions check was replaced in the spec with a [[canExposeDeviceInfo]] MediaDevices slot, set on getUserMedia()
grant.
This makes the actively capturing test redundant as a track cannot become active without a getUserMedia()
grant.
Removing the actively capturing test will resolve a defect where actively capturing tracks can be prematurely GC'd causing loss of "devicechange" events.
With provision of "devicechange" events in more circumstances, we should only add events for devices that should be exposed.
"User Agents MAY add fuzzing on the timing of events to avoid cross-origin activity correlation."
Waiting for focus before dispatch would provide the best protection against cross-origin activity correlation. With the plan to wait for focus in enumerateDevices()
, there would be little value in dispatching "devicechange" before enumerateDevices()
could proceed.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
There is a chance that this may result in some associated events no longer
being coalesced into a single devicechange event, but there is little
disadvantage to this while there is an advantage to getting devicechange
events promptly.
Future changes for https://bugzilla.mozilla.org/show_bug.cgi?id=1732409 will
track exactly which devices have changed and so filter out no-op
notifications.
Depends on D132892
Assignee | ||
Comment 2•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
The same list of physical devices can, in a subsequent patch, be returned to
multiple Windows, so that their MediaDevices objects can efficiently keep (and
share) a record of the set of devices when the last "devicechange" event was
queued.
Assignee | ||
Comment 5•3 years ago
|
||
"media.ondevicechange.fakeDeviceChangeEvent.enabled" does not change any
devices and so will not generate any events if/when no-op devicechange events
are filtered out.
The test is rearranged to reduce the wait for no event and run some steps in
parallel, so that the test runs in half the time. This benefit will
accumulate as more scenarios are added to the test.
Assignee | ||
Comment 6•3 years ago
|
||
There was little value in dispatching devicechange before enumerateDevices
could proceed.
Assignee | ||
Comment 7•3 years ago
|
||
"fully active and has focus" is now a sufficient condition for dispatching "devicechange" events if the change in devices should be visible from enumerateDevices().
https://github.com/w3c/mediacapture-main/pull/574/files#diff-1217ca1c44ff30a33dd50c49d03b5cadc9633c789df8ff9370ed4a42859e1211R3146
Permissions checks are replaced with [[canExposeCameraInfo]] and [[canExposeMicrophoneInfo]] slots set by getUserMedia().
https://github.com/w3c/mediacapture-main/pull/641
https://github.com/w3c/mediacapture-main/pull/773
The "media.navigator.permission.disabled" pref is no longer involved in "devicechange" dispatch decisions.
Assignee | ||
Comment 8•3 years ago
|
||
Assignee | ||
Comment 9•3 years ago
|
||
Updated•3 years ago
|
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Comment 13•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bab7826f0f12
https://hg.mozilla.org/mozilla-central/rev/832332286dae
https://hg.mozilla.org/mozilla-central/rev/eb741033c48d
https://hg.mozilla.org/mozilla-central/rev/674481a62e49
Comment 14•3 years ago
|
||
Comment 15•3 years ago
|
||
bugherder |
Description
•