Skip to content

Commit

Permalink
Speaker Toggle Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacakakpo1 committed Oct 13, 2023
1 parent 2189b87 commit 4a92f61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TelnyxWebRTCDemo/Extensions/ViewControllerVoIPExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ extension ViewController : VoIPDelegate {
if(self.isCallOutGoing()){
self.appDelegate.executeOutGoingCall()
}
if(self.isSpeakerActive){
self.telnyxClient?.setSpeaker()
}
break
case .DONE:
self.resetCallStates()
Expand Down
2 changes: 2 additions & 0 deletions TelnyxWebRTCDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ViewController: UIViewController {
var userDefaults: UserDefaults = UserDefaults.init()
var telnyxClient: TxClient?
var incomingCall: Bool = false
var isSpeakerActive : Bool = false

var loadingView: UIAlertController?

Expand Down Expand Up @@ -245,6 +246,7 @@ extension ViewController : UICallScreenDelegate {
}

func onToggleSpeaker(isSpeakerActive: Bool) {
self.isSpeakerActive = isSpeakerActive
if (isSpeakerActive) {
self.telnyxClient?.setSpeaker()
} else {
Expand Down

0 comments on commit 4a92f61

Please sign in to comment.