ImgSelect: MediaStream stop is not a function

1

I asked this question here in Stackoverflow in Portuguese:

getUserMedia has now gone discontinued on non-https connections?

And I noticed that after uploading a system to the server, the camera stopped working. The domain has HTTPS.

Now I'm getting the following error in the Plugin named ImgSelect :

  

imgSelect.min.js: 249 Uncaught TypeError: n.stop is not a function

That is, this function, which existed before, does not exist anymore.

Previously, I learned that the MediaStream.stop method would be removed since it was discontinued.

How can I resolve this problem?

    
asked by anonymous 13.01.2016 / 20:57

1 answer

1

I ended up solving the problem myself. I'm not in favor of changing source code for anything, but in that case I changed the code that ImgSelect had that excerpt:

if (n) n.stop();

For this

 if (n) {
     n.stop ? n.stop() : n.getVideoTracks()[0].stop();
 }

I still had nothing on the internet on the subject, so I decided to ask here in SOPT.

    
15.01.2016 / 19:03