ngx-scanner: Cameras selection doesn't work on Firefox

Bug, feature request, or proposal:

Bug

What is the current behavior?

On Firefox, after having found all the available cameras, the select box that let the user choose which device to use, doesn’t show up.

immagine

This issue still persist if I force the selection of the first available camera found.

immagine

Chrome, on the other hand, works great!

What are the steps to reproduce?

You can reproduce the issue opening this link with Firefox

Which versions of Angular, ngx-scanner, OS, TypeScript, browsers are affected?

Angular version: 5.2.9 ngx-scanner: 1.1.0-dev.c32019 Browser: Firefox Quantum 59.0.3 (64 bit)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Working on my local but not in domain

Hi again.

I’m just writing a little note here. Maybe in this way other people that find themself stucked with a issue like mine, can find a little help.

After a lot of testing, I discoverd the ngx-scanner works really great in most of cases but not in mine. I’m using VMWare Clarity as a HTML/CSS framework and for some reason, the component find the devices in my pc/smarphone, but it never shows up the selectbox with the device selection.

I realy couldn’t understand what whas the problem util yesterday when, inspired from a stackoverflow question, I tried to import in the component {ChangeDetectorRef} from '@angular/core';.

This component has a fuctions called detectChanges(); witch I have to call every time an event occures (for example every time that the browser finds new devices:

displayCameras(cameras: MediaDeviceInfo[]) { console.debug('Devices: ', cameras); this.availableDevices = cameras; this.ref.detectChanges(); }

Or every time the users changes the device onDeviceSelectChange(selectedValue: string) { console.debug('Selection changed: ', selectedValue); this.selectedDevice = this.scanner.getDeviceById(selectedValue); this.ref.detectChanges(); }

In this way, everything works great!