Uncaught TypeError: videoStream.stop is not a function

Recommend this page to a friend!

      JS Webcam  >  All threads  >  Uncaught TypeError: videoStream.stop...  >  (Un) Subscribe thread alerts  
Subject:Uncaught TypeError: videoStream.stop...
Summary:Uncaught TypeError: videoStream.stop is not a function
Messages:2
Author:Miguel Oliviera
Date:2016-03-10 11:45:07
 

  1. Uncaught TypeError: videoStream.stop...   Reply   Report abuse  
Picture of Miguel Oliviera Miguel Oliviera - 2016-03-10 11:45:07
Dear Sir,

I'm testing your package for webcam support, although when i try to stop camera, stop method returns an error:

Uncaught TypeError: videoStream.stop is not a function

at webcam.js:

stop = function(){
if (videoStream){
videoStream.stop();
element.pause();
videoStream = null;
element.src='';
}

Is there something missing? thanks in advcance,
miguel

  2. Re: Uncaught TypeError: videoStream.stop...   Reply   Report abuse  
Picture of Miguel Oliviera Miguel Oliviera - 2016-03-10 12:08:15 - In reply to message 1 from Miguel Oliviera
Hello again,

After reading about this i realize that MediaStream.Stop() is deprecated on Chrome >= 45.

The solutions for that in Webcam.js line 154 is to replace this:

videoStream.stop();

for this:

videoStream.getVideoTracks()[0].stop();