@@ -182,7 +182,7 @@ Stream.prototype._onRemoteSdpSuccess = function() {
182182
183183Stream . prototype . _onRemoteSdpError = function ( event ) {
184184 console . error ( '[stream] Failed to set remote description (unsupported codec on this browser?):' , event ) ;
185- // stop();
185+ this . stop ( ) ;
186186}
187187
188188Stream . prototype . close = function ( event ) {
@@ -198,35 +198,14 @@ Stream.prototype.error = function(event) {
198198}
199199
200200Stream . prototype . stop = function ( ) {
201- // if (this.dataChannel) {
202- // console.log("closing data channels");
203- // this.dataChannel.close();
204- // this.dataChannel = null;
205- // document.getElementById('datachannels').disabled = true;
206- // }
207- // if (localdatachannel) {
208- // console.log("closing local data channels");
209- // localdatachannel.close();
210- // localdatachannel = null;
211- // }
212- // if (audio_video_stream) {
213- // try {
214- // audio_video_stream.stop();
215- // } catch (e) {
216- // for (var i = 0; i < audio_video_stream.getTracks().length; i++)
217- // audio_video_stream.getTracks()[i].stop();
218- // }
219- // audio_video_stream = null;
220- // }
221201 // stop_record();
222- // document.getElementById('remote-video').src = '';
223- // if (this.peerConnection) {
224- // this.peerConnection.close();
225- // this.peerConnection = null;
226- // }
227- // if (ws) {
228- // ws.close();
229- // ws = null;
230- // }
231- // document.documentElement.style.cursor = 'default';
202+ document . getElementById ( 'remote-video' ) . src = '' ;
203+
204+ this . close ( ) ;
205+
206+ if ( this . websocket ) {
207+ this . websocket . close ( ) ;
208+ this . websocket = null ;
209+ }
210+ console . info ( '[stream] Stop.' )
232211}
0 commit comments