@@ -997,13 +997,10 @@ class RTCSession extends EventManager implements Owner {
997997 if (! _audioMuted && audio) {
998998 _audioMuted = true ;
999999 changed = true ;
1000- _toggleMuteAudio (true );
10011000 }
1002-
10031001 if (! _videoMuted && video) {
10041002 _videoMuted = true ;
10051003 changed = true ;
1006- _toggleMuteVideo (true );
10071004 }
10081005
10091006 if (changed) {
@@ -1177,7 +1174,7 @@ class RTCSession extends EventManager implements Owner {
11771174 options['mediaConstraints' ]? ['mandatory' ]? ['video' ] != null ) &&
11781175 rtcOfferConstraints? ['offerToReceiveVideo' ] == null ;
11791176 } catch (e) {
1180- print ('Failed to determine upgrade to video: $e ' );
1177+ logger. w ('Failed to determine upgrade to video: $e ' );
11811178 }
11821179
11831180 if (! _isReadyToReOffer ()) {
@@ -1197,7 +1194,6 @@ class RTCSession extends EventManager implements Owner {
11971194 'reason_phrase' : 'Media Renegotiation Failed'
11981195 });
11991196 });
1200-
12011197 _setLocalMediaStatus ();
12021198
12031199 if (options['useUpdate' ] != null ) {
@@ -1644,6 +1640,7 @@ class RTCSession extends EventManager implements Owner {
16441640 });
16451641 } else if (state ==
16461642 RTCIceConnectionState .RTCIceConnectionStateDisconnected ) {
1643+ if (_state == RtcSessionState .terminated) return ;
16471644 _iceRestart ();
16481645 }
16491646 };
@@ -1921,7 +1918,8 @@ class RTCSession extends EventManager implements Owner {
19211918 if (status_code < 300 || status_code >= 700 ) {
19221919 throw Exceptions .TypeError ('Invalid status_code: $status_code ' );
19231920 }
1924- print ('Rejecting with status code: $status_code , reason: $reason_phrase ' );
1921+ logger.i (
1922+ 'Rejecting with status code: $status_code , reason: $reason_phrase ' );
19251923 request.reply (status_code, reason_phrase, extraHeaders);
19261924 return true ;
19271925 }
@@ -3136,20 +3134,16 @@ class RTCSession extends EventManager implements Owner {
31363134
31373135 void _setLocalMediaStatus () {
31383136 bool enableAudio = true , enableVideo = true ;
3139-
31403137 if (_localHold || _remoteHold) {
31413138 enableAudio = false ;
31423139 enableVideo = false ;
31433140 }
3144-
31453141 if (_audioMuted) {
31463142 enableAudio = false ;
31473143 }
3148-
31493144 if (_videoMuted) {
31503145 enableVideo = false ;
31513146 }
3152-
31533147 _toggleMuteAudio (! enableAudio);
31543148 _toggleMuteVideo (! enableVideo);
31553149 }
@@ -3266,7 +3260,8 @@ class RTCSession extends EventManager implements Owner {
32663260 void _toggleMuteVideo (bool mute) {
32673261 if (_localMediaStream != null ) {
32683262 if (_localMediaStream! .getVideoTracks ().isEmpty) {
3269- logger.w ('Went to mute video but local stream has no video tracks' );
3263+ logger.w (
3264+ 'Went to toggle mute video but local stream has no video tracks' );
32703265 }
32713266 for (MediaStreamTrack track in _localMediaStream! .getVideoTracks ()) {
32723267 track.enabled = ! mute;
0 commit comments