Skip to content

Select box: videoInputSelectTarget --> retrieve only back end scanners #43

Open
@fydelio

Description

@fydelio

II've looked at this example Scan 1D/2D Code from Video Camera
and noticed, that the select box only shows environment facing cameras. I looked at the code of it, copied it and just don't understand why. I copied the code from there (made slight modifications), but I always get all input devices.

let selectElement = this.videoInputSelectTarget

codeReader = new BrowserMultiFormatReader();
codeReader.listVideoInputDevices()
  .then((videoInputDevices) => {
       if (videoInputDevices.length >= 1) {
          videoInputDevices.forEach((element) => {
            const sourceOption = document.createElement('option')
            sourceOption.text = element.label
            sourceOption.value = element.deviceId
            selectElement.appendChild(sourceOption)
        })
    }
})

What modifications would I need to make to only get environment-facing cameras?

Overall, one good documentation with a documented example would really benefit this library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions