Posts

Showing posts from March, 2016

HTML5 video capture from browser: error with "stop() not a function"

A quick blog post about recent changes in the MediaStream API support in modern browsers. I had previously developed a function allowing users to capture images from their webcam, based on tutorials found on the web. Here was my code to initialize the capture canvas: function CaptureImageBeginCapture () { CaptureImageCanvas = $ ( "#ImageCaptureCanvas" )[ 0 ]; var videoObj = { "video" : true }, errBack = function (error) { console . log ( "Video capture error: " , error. code ); }; CaptureImageVideo = $ ( "#ImageCapturePreviewFrame" )[ 0 ]; CaptureImageContext = CaptureImageCanvas . getContext ( "2d" ); // Put video listeners into place if ( navigator .getUserMedia) { // Standard navigator .getUserMedia( videoObj , function (stream) { CaptureImageStream = stream; CaptureImageVideo . src = stream; CaptureImageVideo . play (); }, errBack ); } else if ( n