简体   繁体   中英

How to get active stream or video track (from quagga.js)?

How can i get the active video stream (from the camera) after it has been created using getUserMedia() without any reference?

Is it possible to get the stream from an video object while it is playing?

I am using quagga.js to scan barcodes and i want to activate the torch and zoom capabilities. However, the function from quagga (getActiveTrack()) is not working and I cannot get the stream (or video track) object.

(I am loading quagga.min.js in the browser.)

It is possible to get the stream (mediaStreamTrack) by getting the srcObject from the video element (document.getElementById('video-element').srcObject). I can now switch on/off torch and control zoom while scanning a barcode but it seems i cannot configure torch and zoom at the same time using camera capabilities. But this is another problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM