This commit is contained in:
Max Matteo Staack 2019-05-04 19:31:53 +02:00
parent 8e699b5aac
commit 74fcb2bfcb
2 changed files with 21 additions and 2 deletions

View File

@ -107,9 +107,27 @@ var checkinApp = new Vue({
}
qrcode.callback = this.QrCheckin;
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
navigator.getUserMedia({
// FIX SAFARI CAMERA
if (navigator.mediaDevices === undefined) {
navigator.mediaDevices = {};
}
if (navigator.mediaDevices.getUserMedia === undefined) {
navigator.mediaDevices.getUserMedia = function(constraints) {
var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
if (!getUserMedia) {
return Promise.reject(new Error('getUserMedia is not implemented in this browser'));
}
return new Promise(function(resolve, reject) {
getUserMedia.call(navigator, constraints, resolve, reject);
});
}
}
navigator.mediaDevices.getUserMedia({
video: {
facingMode: 'environment'
},

View File

@ -14,6 +14,7 @@
@include('Shared/Layouts/ViewJavascript')
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->