Closed
Bug 1439351
Opened 8 years ago
Closed 8 years ago
ondevicechange event doesnt fire without active capture or permission
Categories
(Core :: WebRTC: Audio/Video, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1397977
People
(Reporter: bogdanostojic1993, Unassigned)
Details
Attachments
(1 file)
|
7.50 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
Build ID: 20180215111455
Steps to reproduce:
navigator.mediaDevices.ondevicechange = function(event) { console.log(event)};
It should log an event when a audio/video device is plugged in or unplugged.
Instead it doesn't log anything.
Actual results:
OS: Windows 7 (64 bit)
Browser: Firefox 59 & Firefox 60 (Nightly)
Developing a WebRTC app and there is a function that checks what devices are plugged in and the event doesn't fire when i plugg in/out the camera or audio output.
This example works works on chrome 63/64 and it logs the event this is the result:
Event {isTrusted: true, type: "devicechange", target: MediaDevices, currentTarget: MediaDevices, eventPhase: 2, …}
bubbles
:
false
cancelBubble
:
false
cancelable
:
false
composed
:
false
currentTarget
:
MediaDevices {ondevicechange: ƒ}
defaultPrevented
:
false
eventPhase
:
0
isTrusted
:
true
path
:
[]
returnValue
:
true
srcElement
:
MediaDevices {ondevicechange: ƒ}
target
:
MediaDevices {ondevicechange: ƒ}
timeStamp
:
34717.00000000055
type
:
"devicechange"
__proto__
:
Event
Expected results:
There should be a event that fires like in chrome
Comment 1•8 years ago
|
||
The spec has this to say [1]:
> When new media input and/or output devices are made available, or any available input and/or output device becomes unavailable, the User Agent MUST run the following steps in browsing contexts where at least one of the following criteria are met, but in no other contexts:
>
> - The permission state of the "device-info" permission is "granted",
> - any of the input devices are attached to an active MediaStream in the browsing context, or
> - the active document is fully active and has focus.
>
> The steps are:
>
> 1. Set [[storedDeviceList]] to null.
>
> 2. Queue a task that fires a simple event named devicechange at the MediaDevices object.
>
> If a browsing context later comes to meet the criteria (e.g. gains focus), the User Agent MUST execute the steps at that time.
Our impl covers the first two conditions [2] but not the third (fully active and focus) as it seems. We also don't queue up the event to be fired when we later meet the criteria.
jib, as you know the spec better, does this seem like a correct analysis?
[1] https://w3c.github.io/mediacapture-main/getusermedia.html#mediadevices
[2] https://searchfox.org/mozilla-central/rev/9a8d3f8191b15cdca89a7ce044c7bea2dd0462dc/dom/media/MediaDevices.cpp#231
Status: UNCONFIRMED → NEW
Component: Untriaged → WebRTC: Audio/Video
Ever confirmed: true
Flags: needinfo?(jib)
Product: Firefox → Core
Summary: ondevicechange event doesnt fire → ondevicechange event doesnt fire without active capture or permission
Comment 2•8 years ago
|
||
Yes, this is a duplicate of bug 1397977. Ideally we'd wanna fix this at the same time as bug 1397978.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(jib)
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•