basst314 / ngx-webcam

A simple Angular webcam component / pure & minimal, no flash-fallback
https://basst314.github.io/ngx-webcam/?
MIT License
228 stars 104 forks source link

No source names in Firefox #154

Open klauswiesel opened 2 years ago

klauswiesel commented 2 years ago

I am using the webcam contrrol and experience problems in Firefox [102.0.1 (64-bit)]

Using this code works in all other browsers: ` ngAfterViewInit(): void {

this.pollFunction = defer(() => from(WebcamUtil.getAvailableVideoInputs()));

startPoll<any>(
  () => this.pollFunction,
  value => value && value.filter(item => !!item.deviceId).length > 0,
  {interval: 1000}
).pipe(
  takeUntil(this.destroyed$),
).subscribe(devices => {
    this.availableInputs = devices;
    this.availableInputsForSelect = this.availableInputs.map(item => ({value: item.deviceId, label: item.label}))
    if (!this.cameraId) {
      this.cameraId = this.availableInputs[0].deviceId;
    }
  }
)

}`

For Firefox, I do not get the names for the cameras. Switching them works, camera function itself is working