Merge branch 'voip/fix-issue-448' into 'main'

fix: fixed camera is still active after leaving the group call.

Closes famedly-web#448

See merge request famedly/company/frontend/famedlysdk!1069
This commit is contained in:
Nicolas Werner 2022-07-01 18:37:37 +00:00
commit 8b307722a9
2 changed files with 9 additions and 5 deletions

View File

@ -400,13 +400,16 @@ class CallSession {
}
Future<void> initWithInvite(CallType type, RTCSessionDescription offer,
SDPStreamMetadata? metadata, int lifetime) async {
SDPStreamMetadata? metadata, int lifetime, bool isGroupCall) async {
await _preparePeerConnection();
/// only add local stream if it is not a group call.
if (!isGroupCall) {
final stream = await _getUserMedia(type);
if (stream != null) {
addLocalStream(stream, SDPStreamMetadataPurpose.Usermedia);
}
}
if (metadata != null) {
_updateRemoteSDPStreamMetadata(metadata);

View File

@ -197,7 +197,8 @@ class VoIP {
content['offer']['type'],
);
await newCall
.initWithInvite(callType, offer, sdpStreamMetadata, lifetime)
.initWithInvite(
callType, offer, sdpStreamMetadata, lifetime, confId != null)
.then((_) {
// Popup CallingPage for incoming call.
if (!delegate.isBackgroud && confId == null) {