@@ -997,13 +997,10 @@ class RTCSession extends EventManager implements Owner {
997
997
if (! _audioMuted && audio) {
998
998
_audioMuted = true ;
999
999
changed = true ;
1000
- _toggleMuteAudio (true );
1001
1000
}
1002
-
1003
1001
if (! _videoMuted && video) {
1004
1002
_videoMuted = true ;
1005
1003
changed = true ;
1006
- _toggleMuteVideo (true );
1007
1004
}
1008
1005
1009
1006
if (changed) {
@@ -1177,7 +1174,7 @@ class RTCSession extends EventManager implements Owner {
1177
1174
options['mediaConstraints' ]? ['mandatory' ]? ['video' ] != null ) &&
1178
1175
rtcOfferConstraints? ['offerToReceiveVideo' ] == null ;
1179
1176
} catch (e) {
1180
- print ('Failed to determine upgrade to video: $e ' );
1177
+ logger. w ('Failed to determine upgrade to video: $e ' );
1181
1178
}
1182
1179
1183
1180
if (! _isReadyToReOffer ()) {
@@ -1197,7 +1194,6 @@ class RTCSession extends EventManager implements Owner {
1197
1194
'reason_phrase' : 'Media Renegotiation Failed'
1198
1195
});
1199
1196
});
1200
-
1201
1197
_setLocalMediaStatus ();
1202
1198
1203
1199
if (options['useUpdate' ] != null ) {
@@ -1644,6 +1640,7 @@ class RTCSession extends EventManager implements Owner {
1644
1640
});
1645
1641
} else if (state ==
1646
1642
RTCIceConnectionState .RTCIceConnectionStateDisconnected ) {
1643
+ if (_state == RtcSessionState .terminated) return ;
1647
1644
_iceRestart ();
1648
1645
}
1649
1646
};
@@ -1921,7 +1918,8 @@ class RTCSession extends EventManager implements Owner {
1921
1918
if (status_code < 300 || status_code >= 700 ) {
1922
1919
throw Exceptions .TypeError ('Invalid status_code: $status_code ' );
1923
1920
}
1924
- print ('Rejecting with status code: $status_code , reason: $reason_phrase ' );
1921
+ logger.i (
1922
+ 'Rejecting with status code: $status_code , reason: $reason_phrase ' );
1925
1923
request.reply (status_code, reason_phrase, extraHeaders);
1926
1924
return true ;
1927
1925
}
@@ -3136,20 +3134,16 @@ class RTCSession extends EventManager implements Owner {
3136
3134
3137
3135
void _setLocalMediaStatus () {
3138
3136
bool enableAudio = true , enableVideo = true ;
3139
-
3140
3137
if (_localHold || _remoteHold) {
3141
3138
enableAudio = false ;
3142
3139
enableVideo = false ;
3143
3140
}
3144
-
3145
3141
if (_audioMuted) {
3146
3142
enableAudio = false ;
3147
3143
}
3148
-
3149
3144
if (_videoMuted) {
3150
3145
enableVideo = false ;
3151
3146
}
3152
-
3153
3147
_toggleMuteAudio (! enableAudio);
3154
3148
_toggleMuteVideo (! enableVideo);
3155
3149
}
@@ -3266,7 +3260,8 @@ class RTCSession extends EventManager implements Owner {
3266
3260
void _toggleMuteVideo (bool mute) {
3267
3261
if (_localMediaStream != null ) {
3268
3262
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' );
3270
3265
}
3271
3266
for (MediaStreamTrack track in _localMediaStream! .getVideoTracks ()) {
3272
3267
track.enabled = ! mute;
0 commit comments