Skip to content

Commit 3dae63d

Browse files
authored
Merge pull request #168 from cybex-dev/feat_web_call_interactions
Feat: add missing Twilio.Call functions
2 parents 8cf4a39 + c2e0128 commit 3dae63d

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

lib/_internal/twilio_voice_web.dart

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ class Call extends MethodChannelTwilioCall {
645645
return Future.value(false);
646646
}
647647

648-
/// Not currently implemented for web
648+
/// Toggle mute on/off. Returns true if successful, false otherwise.
649649
@override
650650
Future<bool?> toggleMute(bool isMuted) async {
651651
Logger.logLocalEvent(isMuted ? "Mute" : "Unmute", prefix: "");
@@ -655,6 +655,16 @@ class Call extends MethodChannelTwilioCall {
655655
return isMuted;
656656
}
657657

658+
/// Is call muted. Returns true if muted, false otherwise.
659+
@override
660+
Future<bool> isMuted() async {
661+
if (_jsCall != null) {
662+
return _jsCall!.isMuted();
663+
} else {
664+
return false;
665+
}
666+
}
667+
658668
/// Not currently implemented for web
659669
/// https://github.com/twilio/twilio-voice.js/issues/32
660670
/// Call holding should be done server-side as suggested by @ryan-rowland here(https://github.com/twilio/twilio-voice.js/issues/32#issuecomment-1016872545)
@@ -669,6 +679,18 @@ class Call extends MethodChannelTwilioCall {
669679
return Future.value(false);
670680
}
671681

682+
/// Not currently implemented for web
683+
@override
684+
Future<bool> isHolding() {
685+
return Future.value(false);
686+
}
687+
688+
/// Not currently implemented for web
689+
@override
690+
Future<bool> isOnSpeaker() {
691+
return Future.value(false);
692+
}
693+
672694
/// Answers an inbound call. Returns true if successful, false otherwise.
673695
/// See [twilio_js.Call.accept]
674696
@override

0 commit comments

Comments
 (0)