Skip to content

Commit

Permalink
fix navigator.mediaDevices.getUserMedia undefined (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-qiqi authored Jul 8, 2022
1 parent ced1209 commit 8bcdbc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/html5-qrcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ export class Html5Qrcode {
* @returns a Promise with list of {@code CameraDevice}.
*/
public static getCameras(): Promise<Array<CameraDevice>> {
if (navigator.mediaDevices) {
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
return Html5Qrcode.getCamerasFromMediaDevices();
}

Expand Down

0 comments on commit 8bcdbc0

Please sign in to comment.