From a1d10a00131caf27108626cbebf8f16fc7378277 Mon Sep 17 00:00:00 2001 From: KGCybeX Date: Sat, 16 Sep 2023 01:17:03 +0200 Subject: [PATCH 1/3] Add `isMuted` --- lib/_internal/twilio_voice_web.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/_internal/twilio_voice_web.dart b/lib/_internal/twilio_voice_web.dart index 4275f248..1798d3b0 100644 --- a/lib/_internal/twilio_voice_web.dart +++ b/lib/_internal/twilio_voice_web.dart @@ -655,6 +655,16 @@ class Call extends MethodChannelTwilioCall { return isMuted; } + /// Is call muted. Returns true if muted, false otherwise. + @override + Future isMuted() async { + if (_jsCall != null) { + return _jsCall!.isMuted(); + } else { + return false; + } + } + /// Not currently implemented for web /// https://github.com/twilio/twilio-voice.js/issues/32 /// Call holding should be done server-side as suggested by @ryan-rowland here(https://github.com/twilio/twilio-voice.js/issues/32#issuecomment-1016872545) From d888a13a49aa0fc057dccbfa11e4650805ec515a Mon Sep 17 00:00:00 2001 From: KGCybeX Date: Sat, 16 Sep 2023 01:17:39 +0200 Subject: [PATCH 2/3] Add `isHolding`, `isOnSpeaker` stubs --- lib/_internal/twilio_voice_web.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/_internal/twilio_voice_web.dart b/lib/_internal/twilio_voice_web.dart index 1798d3b0..c6fe4682 100644 --- a/lib/_internal/twilio_voice_web.dart +++ b/lib/_internal/twilio_voice_web.dart @@ -679,6 +679,18 @@ class Call extends MethodChannelTwilioCall { return Future.value(false); } + /// Not currently implemented for web + @override + Future isHolding() { + return Future.value(false); + } + + /// Not currently implemented for web + @override + Future isOnSpeaker() { + return Future.value(false); + } + /// Answers an inbound call. Returns true if successful, false otherwise. /// See [twilio_js.Call.accept] @override From c2e0128e11cd7d69dd6411f7101ff4318ba358c0 Mon Sep 17 00:00:00 2001 From: KGCybeX Date: Sat, 16 Sep 2023 01:17:51 +0200 Subject: [PATCH 3/3] Update docs --- lib/_internal/twilio_voice_web.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_internal/twilio_voice_web.dart b/lib/_internal/twilio_voice_web.dart index c6fe4682..5bd814c6 100644 --- a/lib/_internal/twilio_voice_web.dart +++ b/lib/_internal/twilio_voice_web.dart @@ -645,7 +645,7 @@ class Call extends MethodChannelTwilioCall { return Future.value(false); } - /// Not currently implemented for web + /// Toggle mute on/off. Returns true if successful, false otherwise. @override Future toggleMute(bool isMuted) async { Logger.logLocalEvent(isMuted ? "Mute" : "Unmute", prefix: "");