chore: deprecate isBackground
This was used by callkeepv1 to fire a system notification or in call flutter screens on a new call, has always been set to false on web
This commit is contained in:
parent
10e6b9b0e6
commit
6246dd1301
|
|
@ -809,9 +809,7 @@ class CallSession {
|
||||||
|
|
||||||
if (purpose == SDPStreamMetadataPurpose.Usermedia) {
|
if (purpose == SDPStreamMetadataPurpose.Usermedia) {
|
||||||
speakerOn = type == CallType.kVideo;
|
speakerOn = type == CallType.kVideo;
|
||||||
if (!voip.delegate.isWeb &&
|
if (!voip.delegate.isWeb && stream.getAudioTracks().isNotEmpty) {
|
||||||
!voip.delegate.isBackgroud &&
|
|
||||||
stream.getAudioTracks().isNotEmpty) {
|
|
||||||
final audioTrack = stream.getAudioTracks()[0];
|
final audioTrack = stream.getAudioTracks()[0];
|
||||||
audioTrack.enableSpeakerphone(speakerOn);
|
audioTrack.enableSpeakerphone(speakerOn);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ abstract class WebRTCDelegate {
|
||||||
void handleMissedCall(CallSession session);
|
void handleMissedCall(CallSession session);
|
||||||
void handleNewGroupCall(GroupCall groupCall);
|
void handleNewGroupCall(GroupCall groupCall);
|
||||||
void handleGroupCallEnded(GroupCall groupCall);
|
void handleGroupCallEnded(GroupCall groupCall);
|
||||||
bool get isBackgroud;
|
|
||||||
bool get isWeb;
|
bool get isWeb;
|
||||||
|
|
||||||
/// This should be set to false if any calls in the client are in kConnected
|
/// This should be set to false if any calls in the client are in kConnected
|
||||||
|
|
@ -252,18 +251,11 @@ class VoIP {
|
||||||
currentCID = callId;
|
currentCID = callId;
|
||||||
|
|
||||||
// Popup CallingPage for incoming call.
|
// Popup CallingPage for incoming call.
|
||||||
if (!delegate.isBackgroud && confId == null && !newCall.callHasEnded) {
|
if (confId == null && !newCall.callHasEnded) {
|
||||||
delegate.handleNewCall(newCall);
|
delegate.handleNewCall(newCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
onIncomingCall.add(newCall);
|
onIncomingCall.add(newCall);
|
||||||
|
|
||||||
if (delegate.isBackgroud) {
|
|
||||||
/// Forced to enable signaling synchronization until the end of the call.
|
|
||||||
client.backgroundSync = true;
|
|
||||||
|
|
||||||
///TODO: notify the callkeep that the call is incoming.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> onCallAnswer(
|
Future<void> onCallAnswer(
|
||||||
|
|
@ -329,9 +321,7 @@ class VoIP {
|
||||||
Future<void> onCallHangup(String roomId, String _ /*senderId unused*/,
|
Future<void> onCallHangup(String roomId, String _ /*senderId unused*/,
|
||||||
Map<String, dynamic> content) async {
|
Map<String, dynamic> content) async {
|
||||||
// stop play ringtone, if this is an incoming call
|
// stop play ringtone, if this is an incoming call
|
||||||
if (!delegate.isBackgroud) {
|
|
||||||
delegate.stopRingtone();
|
delegate.stopRingtone();
|
||||||
}
|
|
||||||
Logs().v('[VOIP] onCallHangup => ${content.toString()}');
|
Logs().v('[VOIP] onCallHangup => ${content.toString()}');
|
||||||
final String callId = content['call_id'];
|
final String callId = content['call_id'];
|
||||||
final call = calls[callId];
|
final call = calls[callId];
|
||||||
|
|
@ -523,6 +513,7 @@ class VoIP {
|
||||||
if (_turnServerCredentials == null) {
|
if (_turnServerCredentials == null) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
'username': _turnServerCredentials!.username,
|
'username': _turnServerCredentials!.username,
|
||||||
|
|
@ -557,9 +548,7 @@ class VoIP {
|
||||||
final newCall = createNewCall(opts);
|
final newCall = createNewCall(opts);
|
||||||
currentCID = callId;
|
currentCID = callId;
|
||||||
await newCall.initOutboundCall(type).then((_) {
|
await newCall.initOutboundCall(type).then((_) {
|
||||||
if (!delegate.isBackgroud) {
|
|
||||||
delegate.handleNewCall(newCall);
|
delegate.handleNewCall(newCall);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
currentCID = callId;
|
currentCID = callId;
|
||||||
return newCall;
|
return newCall;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue