Comments (9)
How did you get the scanner to work in portrait? No matter what, it only scans in landscape. iOS 15 seems to have changed something.
from instascan.
not working after i click this url sir
from instascan.
@yuresko is the basis of your code the same as mine or different? Could I see what you're doing?
from instascan.
This is how I'm calling it in the html...and it's using instascan.min.js from the releases
function startCam() {
var scanner = new Instascan.Scanner({
video: document.getElementById('preview'),
scanPeriod: 5,
mirror: false,
refractoryPeriod: 10000
});
scanner.addListener('scan', function(content) {
document.getElementById("qrusername").value = content;
// alert(content);
//window.open(content);
//window.location.href=content;
});
Instascan.Camera.getCameras().then(function(cameras) {
if (cameras.length > 0) {
scanner.start(cameras[1]);
$('[name="options"]').on('change', function() {
if ($(this).val() == 1) {
if (cameras[1] != "") {
scanner.start(cameras[1]);
} else {
alert('No Front camera found!');
}
} else if ($(this).val() == 2) {
if (cameras[0] != "") {
scanner.start(cameras[0]);
} else {
alert('No Back camera found!');
}
}
});
} else {
console.error('No cameras found.');
alert('No cameras found.');
}
}).catch(function(e) {
console.error(e);
alert(e);
});
}
from instascan.
@yuresko you've got a few differences in your code compared to my code.
I am not using the instascan.min.js from the releases. I switched to one I found in the forums that I have attached.
from instascan.
Ahh gotchya...I tried yours and it did the same thing. No portrait, only landscape. Thanks for your help, will keep digging.
from instascan.
@yuresko here's a css workaround I figured out.
CSS
`
`
HTML
<div id="warning-message" style="text-align: center;"> <p> TEXT EXPLAINING PAGE ONLY WORKS IN PORTAIT </p> </div>
from instascan.
@RileyIsOnGitHub https://github.com/huangsong/instascan/tree/master/docs there is my test code. it work well on my iphone7p 15.2 and pixel3 android 12
from instascan.
not working after i click this url sir
https://github.com/huangsong/instascan/tree/master/docs
from instascan.
Related Issues (20)
- Tmz
- instascanaaa HOT 1
- Getting o.forEach is not a function while running on https. Please give me any solution. but it works on localhost
- Only one instance of babel-polyfill is allowed HOT 1
- Instascan is not displaying the camera although camera is active HOT 1
- Error : Cannot access video stream (TypeError). HOT 1
- Orientation Bug on iOS 15. HOT 5
- iOS 15 loads camera, not picking up QR code on any browser HOT 1
- Uncaught RangeError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': Out of memory at ImageData creation
- i
- iOS 15 Cannot Detect QRCode !!!! HOT 7
- Result cant show up in console log
- Uncaught (in promise) TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed. HOT 1
- Instascan do not recognize coloured QR codes, e.g. white code on green or red background HOT 3
- Error Invalid length
- iOS back camera cannot be used HOT 2
- Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true HOT 1
- cannot scan barcode only qr HOT 2
- getting [{"id":"","name":"null","_stream":null}] after Webview 118 update
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instascan.