Firefox 32-bit does not fire ondevicechange event

Viewed 211

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.

2 Answers

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.

Related