Fix tensor cleanup and orphan event listener (#171)

Closes: #166

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>

Reviewed-on: #171
This commit is contained in:
2024-04-11 19:25:02 -07:00
parent e1464df3f0
commit b732d001dc
3 changed files with 18 additions and 12 deletions

View File

@@ -25,12 +25,14 @@ export default {
},
closeCamera () {
this.cameraStream.getTracks().forEach( t => t.stop())
this.cameraStream = null
this.videoAvailable = false
},
captureVidFrame() {
const vidViewer = this.$refs.vid_viewer
vidViewer.pause()
let tempCVS = document.createElement('canvas')
tempCVS.id = 'temp-video-canvas'
tempCVS.height = vidViewer.videoHeight || parseInt(vidViewer.style.height)
tempCVS.width = vidViewer.videoWidth || parseInt(vidViewer.style.width)
const tempCtx = tempCVS.getContext('2d')