fix: fixed camera is still active after leaving the group call.
This commit is contained in:
parent
f3c1eda97f
commit
425274cb9c
|
|
@ -400,12 +400,15 @@ 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();
|
||||||
|
|
||||||
final stream = await _getUserMedia(type);
|
/// only add local stream if it is not a group call.
|
||||||
if (stream != null) {
|
if (!isGroupCall) {
|
||||||
addLocalStream(stream, SDPStreamMetadataPurpose.Usermedia);
|
final stream = await _getUserMedia(type);
|
||||||
|
if (stream != null) {
|
||||||
|
addLocalStream(stream, SDPStreamMetadataPurpose.Usermedia);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metadata != null) {
|
if (metadata != null) {
|
||||||
|
|
|
||||||
|
|
@ -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