Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Play, Pause, Stop, Destroy methods #137

Open
gregg-cbs opened this issue Jul 6, 2024 · 0 comments
Open

Add Play, Pause, Stop, Destroy methods #137

gregg-cbs opened this issue Jul 6, 2024 · 0 comments

Comments

@gregg-cbs
Copy link

As another issue mentions this reader once initialized does not stop, it causes a memory leak and high battery consumption on mobile.

controls.stop() seems to do nothing and there is no controls.play() to resume.

There is also no codeReader.stop() or .destroy() or .pause() or .play()

codeReader = new BrowserQRCodeReader(undefined, {
  delayBetweenScanAttempts: scanDelay
});

// this would be amazing
codeReader.stop()
codeReader.play()
codeReader.destroy()

as noted by others this does not work but even if it did there is no way to resume:

codeReader.decodeFromConstraints({ video: constraint }, videoRef, (result)=> {
  console.log(result?.getText())
})
.then((controls: IScannerControls) => {
  // does nothing
  controls.stop()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant