Sven van de Scheur created CB-10311:
---------------------------------------

             Summary: cordova-plugin-camera seems to be using deprecated 
MediaStream.stop() in browser
                 Key: CB-10311
                 URL: https://issues.apache.org/jira/browse/CB-10311
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin Camera
    Affects Versions: 3.5.0
         Environment: Chrome 47
            Reporter: Sven van de Scheur
            Priority: Minor


The cordova-plugin-camera camera proxy for utilizes a deprecated 
MediaStream.stop(). On Chrome 47 this throws an exception:

"Uncaught TypeError: localMediaStream.stop is not a function" thrown from 
CameraProxy.js:69:
 
        // stop video stream, remove video and button
        localMediaStream.stop();

According to 
https://developers.google.com/web/updates/2015/07/mediastream-deprecations?hl=en
 MediaStream.stop() has been deprecated in favor of MediaStreamTrack.stop(). 
And the code should be changed accordingly.

I think this should be changed roughly to:

        // stop video stream, remove video and button
        var tracks = localMediaStream.getTracks();
        tracks.forEach(function(track) {
                track.stop();
        })



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to