gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

QrcodeStream is not working on iPadOS/iOS15 #264

Closed ykjp closed 2 years ago

ykjp commented 2 years ago

In iPadOS/iOS15 QrcodeStream does not work. It will not show anything on video canvas directly. Demo Page also has the same problem. If I change the iPhone/iPad direction or scroll the page to re-render the page, video canvas will be appeared.

↓Video https://user-images.githubusercontent.com/91316243/134649049-1985fc8c-d4bf-45f4-8509-8a42e6a42d7d.MP4

Just iPadOS15/iOS15 has this problem.

ykjp commented 2 years ago

When I update MacOS to BigSur11.6, MacOS Safari(Version 15) has the same problem as iPhone/iPadOS15. It will show video canvas when detected QRCode.

MacOS Chrome will show video canvas directly.

m1llipede commented 2 years ago

Also having this issue on iPad running IOS15. The camera feed will, at times, not render footage from the camera. If I click the home button then reopen safari the camera feed is usually restored.

Any solution for this?

uaru commented 2 years ago

Another workaround is to change the orientation of the device, eg. from vertical to horizontal, and back - this is probably the quickest way to force the browser to repaint the camera area without reloading.

gruhn commented 2 years ago

Ok, I have a theory. Can you guys confirm that this demo reproduces the problem?

uaru commented 2 years ago

@gruhn It works on my iPad with iOS 15 - when I click on either links on demo page, the camera just works.

gruhn commented 2 years ago

@uaru so the demo does not reproduce the problem for you?

gruhn commented 2 years ago

Also, does the issue still occur here (pick any demo): https://gruhn.github.io/select-camera-demo/dist/

Otherwise I have a fix.

uaru commented 2 years ago

@gruhn With those links everything works now.

gruhn commented 2 years ago

Fix is out: https://github.com/gruhn/vue-qrcode-reader/releases/tag/v3.0.4

I'll close this. Make a noise if the issue still occurs.

rrrrando commented 2 years ago

This is still not working with vue3. I managed to get a workaround by adding an empty div above the component and then toggling it after i turn on the camera. Like this:

<div v-if="active"></div>
<qrcode-stream :camera="camera" @decode="onDecode" @init="onInit" />

And then in the script:

const active = ref(false);
const activate = async () => {
    active.value = true;
    setTimeout(() => {
        active.value = false;
    }, 50);
};

const onDecode = async (code) => {
    camera.value = `off`;
    //Validate code
    camera.value = `auto`;
    activate();
}
matiasleybadixtra commented 2 years ago

@rrrrando works for me! 👍🏻