fix: fixed camera is still active after leaving the group call.
This commit is contained in:
		
							parent
							
								
									f3c1eda97f
								
							
						
					
					
						commit
						425274cb9c
					
				|  | @ -400,13 +400,16 @@ class CallSession { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Future<void> initWithInvite(CallType type, RTCSessionDescription offer, |   Future<void> initWithInvite(CallType type, RTCSessionDescription offer, | ||||||
|       SDPStreamMetadata? metadata, int lifetime) async { |       SDPStreamMetadata? metadata, int lifetime, bool isGroupCall) async { | ||||||
|     await _preparePeerConnection(); |     await _preparePeerConnection(); | ||||||
| 
 | 
 | ||||||
|  |     /// only add local stream if it is not a group call. | ||||||
|  |     if (!isGroupCall) { | ||||||
|       final stream = await _getUserMedia(type); |       final stream = await _getUserMedia(type); | ||||||
|       if (stream != null) { |       if (stream != null) { | ||||||
|         addLocalStream(stream, SDPStreamMetadataPurpose.Usermedia); |         addLocalStream(stream, SDPStreamMetadataPurpose.Usermedia); | ||||||
|       } |       } | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     if (metadata != null) { |     if (metadata != null) { | ||||||
|       _updateRemoteSDPStreamMetadata(metadata); |       _updateRemoteSDPStreamMetadata(metadata); | ||||||
|  |  | ||||||
|  | @ -197,7 +197,8 @@ class VoIP { | ||||||
|       content['offer']['type'], |       content['offer']['type'], | ||||||
|     ); |     ); | ||||||
|     await newCall |     await newCall | ||||||
|         .initWithInvite(callType, offer, sdpStreamMetadata, lifetime) |         .initWithInvite( | ||||||
|  |             callType, offer, sdpStreamMetadata, lifetime, confId != null) | ||||||
|         .then((_) { |         .then((_) { | ||||||
|       // Popup CallingPage for incoming call. |       // Popup CallingPage for incoming call. | ||||||
|       if (!delegate.isBackgroud && confId == null) { |       if (!delegate.isBackgroud && confId == null) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue