Quantcast
Channel: Questions in topic: "webcam"
Viewing all articles
Browse latest Browse all 256

WebGL Webcam light keeps enabled after stoping WebCamTexture

$
0
0
Hey, I'm using the following code to enable and disable a WebCamTexture: // enable _webcamTexture = new WebCamTexture (WebCamTexture.devices[_cameraIndex].name); _webcamTexture.Play (); // disable _webcamTexture.Stop (); _webcamTexture = null; It works fine on the Editor and on WebGL. However, when I disable the WebCam on the WebGL build, the webcam light continues enabled and I' not able to disable it. Already tried disabling it, calling a function with the following code in the browser but no luck. if (localStream === undefined) { var MediaStream = window.MediaStream; if (typeof MediaStream === 'undefined' && typeof webkitMediaStream !== 'undefined') { MediaStream = webkitMediaStream; } /*global MediaStream:true */ if (typeof MediaStream !== 'undefined' && !('stop' in MediaStream.prototype)) { MediaStream.prototype.stop = function() { this.getVideoTracks().forEach(function(track) { track.stop(); }); }; } } else { localStream.getTracks().forEach(function(track) { track.stop() }); } Thanks for any help.

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>