]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8219 #resolve Correctly stop the tracks.
authorKen Rice <krice@freeswitch.org>
Tue, 29 Sep 2015 16:46:15 +0000 (11:46 -0500)
committerKen Rice <krice@freeswitch.org>
Tue, 29 Sep 2015 16:46:15 +0000 (11:46 -0500)
getusermedia.stop() has been deprecated. we now need to call stop on
each individual track.

html5/verto/js/src/jquery.FSRTC.js

index ddd376562d6f2e1112aaf9be886dd3b2c33384b6..1ed2a54e9bb2d9fc606d93a913dfefa08b819580 100644 (file)
             if(typeof self.localStream.stop == 'function') {
                 self.localStream.stop();
             } else {
-                self.localStream.active = false;
+               if (self.localStream.active){
+                    var tracks = self.localStream.getTracks();
+                    console.error(tracks);
+                   tracks.forEach(function(track, index){
+                       console.log(track);
+                       track.stop();
+                   })
+                }
             }
             self.localStream = null;
         }
             if(typeof self.options.localVideoStream.stop == 'function') {
                self.options.localVideoStream.stop();
             } else {
-                self.options.localVideoStream.active = false;
+               if (self.localVideoStream.active){
+                    var tracks = self.localVideoStream.getTracks();
+                    console.error(tracks);
+                   tracks.forEach(function(track, index){
+                       console.log(track);
+                       track.stop();
+                   })
+                }
             }
         }