You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have implemented instascan for my webapp. Its working fine on localhost but not working(not showing camera) on server even though i m running on HTTPS.
also modal is not hiding on error.
plz guide me.
thanx.
my code is as below:
<script type="text/javascript">
var url = {!! json_encode(url('/')) !!};
function scanActivity(e){
e.preventDefault();
$('#scanBill').modal('show');
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
scanner.addListener('scan', function (content) {
if(content.length != 14){
$('#scanBill').modal('hide');
toastr["warning"]("Invalid QR Code!","", {
"positionClass": "toast-bottom-center"
});
return;
} else {
$.ajax({
type: 'GET',
url: url + '/admin/loading-qrcode-scan/' + content,
success: function(data)
{
if (data.result = 'success') {
alert(data.result);
$('#scanBill').modal('hide');
location.reload();
} else {
alert(data.result);
$('#scanBill').modal('hide');
location.reload();
}
}
});
}
});
Instascan.Camera.getCameras().then(function (cameras) {
if (cameras.length > 0) {
scanner.start(cameras[1]);
} else {
$('#scanBill').modal('hide');
toastr["error"]("No Camera Found for Scanning on this device!!!", "Error",{
"positionClass": "toast-bottom-center"
});
return;
}
}).catch(function (err) {
console.error(err);
$('#scanBill').modal('hide');
toastr["error"]("Requested Device is not appropriate for scanning!!!", "Error",{
"positionClass": "toast-bottom-center"
});
});
</script>
The text was updated successfully, but these errors were encountered:
for me, it seems that on a laptop, it works, but on a mobile device (iphone 10S and 11) it does not. On mobile, I just get a black box and no video. I can confirm this problem exists even on the example page: https://schmich.github.io/instascan/
i have implemented instascan for my webapp. Its working fine on localhost but not working(not showing camera) on server even though i m running on HTTPS.
also modal is not hiding on error.
plz guide me.
thanx.
my code is as below:
<script type="text/javascript"> var url = {!! json_encode(url('/')) !!}; function scanActivity(e){ e.preventDefault(); $('#scanBill').modal('show'); let scanner = new Instascan.Scanner({ video: document.getElementById('preview') }); scanner.addListener('scan', function (content) { if(content.length != 14){ $('#scanBill').modal('hide'); toastr["warning"]("Invalid QR Code!","", { "positionClass": "toast-bottom-center" }); return; } else { $.ajax({ type: 'GET', url: url + '/admin/loading-qrcode-scan/' + content, success: function(data) { if (data.result = 'success') { alert(data.result); $('#scanBill').modal('hide'); location.reload(); } else { alert(data.result); $('#scanBill').modal('hide'); location.reload(); } } }); } }); Instascan.Camera.getCameras().then(function (cameras) { if (cameras.length > 0) { scanner.start(cameras[1]); } else { $('#scanBill').modal('hide'); toastr["error"]("No Camera Found for Scanning on this device!!!", "Error",{ "positionClass": "toast-bottom-center" }); return; } }).catch(function (err) { console.error(err); $('#scanBill').modal('hide'); toastr["error"]("Requested Device is not appropriate for scanning!!!", "Error",{ "positionClass": "toast-bottom-center" }); }); </script>The text was updated successfully, but these errors were encountered: