Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10311

cordova-plugin-camera seems to be using deprecated MediaStream.stop() in browser

    XMLWordPrintableJSON

Details

    Description

      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(); }

      )

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              svenv Sven van de Scheur
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified