4

I'm having trouble using the MediaDevices.ondevicechange event in Firefox (77.0) 32-Bit Version. The event is not fired at all. In Firefox (77.0) 64-Bit the code works as expected. My machine is a 64-Bit Windows 10 desktop computer.

The example on the official mozilla site doesn't work either - it doesn't detect device changes in 32-Bit Firefox.

Anyone else experiencing this issue? Is this a bug or the expected behavior?

Is there a way to differentiate between Firefox 32- and 64-Bit with javascript? I don't see a way to do this with just feature detection, as they behave the same (code wise). If yes i could at least implement some kind of fallback.

Any help would be appreciated.

Community
  • 1
  • 1
NickG
  • 550
  • 4
  • 18

2 Answers2

3

For extensive discussion of way to differentiate between 32 and 64-Bit question, see:

Detect 64-bit or 32-bit Windows from User Agent or Javascript?

Nick
  • 461
  • 2
  • 10
  • 1
    Thank you for your response, it seems that detecting 64 vs 32-Bit Firefox is not possible, just for the system. The problem with this is, that you can install a Firefox 32-Bit on a 64-Bit machine. In that case the detection would fail. – NickG Jun 03 '20 at 08:28
0

There should be no difference between the 32-bit and 64-bit versions of Firefox when it comes to the devicechange event.

My guess is you're running with different profiles in the two versions, and you've granted persistent camera or microphone permission to your site in one and not the other.

Firefox has a bug which limits the devicechange event to pages that are either already actively using the camera or microphone at the moment, or have been granted persistent camera or microphone permission (you've checked ☑ Remember this decision) in the past.

You can test it out in Firefox here:

  1. Insert or remove a USB or bluetooth camera → nothing happens
  2. Click the Start camera! button and share a camera.
  3. Insert or remove a USB or bluetooth camera → "device change!" is logged

This bug will hopefully be addressed soon.

jib
  • 40,579
  • 17
  • 100
  • 158
  • Thank you for your response. However the difference in behavior is a thing: I used two clean installations 32-Bit and 64-Bit each in a private tab, one after another. On the Mozilla page i click "start", then accept the audio permission dialog (there is no remember this decision checkbox on the Mozilla ondevicechange page for me). If I unplug my microphone, it takes some seconds, but in 64-Bit the microphone disappears from the list of audio devices. In 32-Bit, no matter how long i wait, the microphone stays in the list. – NickG Jun 03 '20 at 06:56
  • I tried again using the fiddle you posted, with the same results. Firefox 64-bit, after accepting and pressing start, shows the "device change!" output, Firefox 32-Bit does not. – NickG Jun 03 '20 at 11:35