Skip to content
Snippets Groups Projects
Commit 9e739b3c authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Fix mobile init camera - qr code scanner

parent e3970ae3
No related branches found
No related tags found
No related merge requests found
Pipeline #13298 passed
......@@ -102,8 +102,12 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
that._('#videoSource').appendChild(opt);
}
console.log(devices_map);
that.activeCamera = Array.from(devices_map)[0][0];
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
that.activeCamera = 'environment';
} else {
that.activeCamera = Array.from(devices_map)[0][0];
}
})
.catch(function (err) {
......@@ -126,7 +130,12 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
}
}
this._log(`${results.length} results found`);
that.activeCamera =Array.from(devices_map)[0][0];
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
that.activeCamera = 'environment';
} else {
that.activeCamera = Array.from(devices_map)[0][0];
}
resolve(results);
}
MediaStreamTrack.getSources(callback);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment