Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Webcam stream not closed when using Webcam.reset(); #2

Closed
websam101 opened this Issue · 1 comment

2 participants

@websam101

This is more a request then a bug...

By adding 2 lines, it is easely fixed.

localStream = stream;
localStream.stop();

First one on the attach: function

            function(stream) {
                localStream = stream;
                // got access, attach stream to video
                video.src = window.URL.createObjectURL( stream ) || stream;
                Webcam.loaded = true;
                Webcam.live = true;
                Webcam.dispatch('load');
                Webcam.dispatch('live');
            },

And the last one in the reset: function

        if (this.userMedia) {
            localStream.stop();
            delete this.canvas;
            delete this.context;
            delete this.video;
        }

Thank's

@jhuckaby
Owner

All fixed, thanks for reporting this!

@jhuckaby jhuckaby closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.