feat: 添加一个qrgb的demo

This commit is contained in:
539943419 committed 2025-01-27 20:51:37 +08:00
1 parent 4fecf18da7
commit 46b1da589f
6 files changed
+278 -3

No files matched your search

+2 -3
View File
@@ -21,12 +21,10 @@ let timer: any | undefined = undefined
const scannerResult = new Set()
const getQRData = (videoFrame: VideoFrame): string | undefined => {
const getQRData = (videoFrame: ImageBitmap ): string | undefined => {
const canvas = document.createElement('canvas')
// const canvas = testCtx.value!
// @ts-ignore
canvas.width = videoFrame.width
// @ts-ignore
canvas.height = videoFrame.height
// console.log(canvas.width, canvas.height)
const ctx = canvas.getContext('2d')
@@ -82,6 +80,7 @@ onMounted(async () => {
onBeforeUnmount(() => {
stream?.getTracks().forEach(track => track.stop())
clearInterval(timer)
})
</script>