Skip to content

Add Play, Pause, Stop, Destroy methods #137

@gregg-cbs

Description

@gregg-cbs

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()
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions