Reply to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 9c3ecbc77d
commit bc00b87783

@ -47,10 +47,10 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
var hangUpButton: UIButton! var hangUpButton: UIButton!
var speakerPhoneButton: UIButton! var speakerPhoneButton: UIButton!
var audioMuteButton: UIButton! var audioModeMuteButton: UIButton!
var audioVideoButton: UIButton! var audioModeVideoButton: UIButton!
var videoMuteButton: UIButton! var videoModeMuteButton: UIButton!
var videoVideoButton: UIButton! var videoModeVideoButton: UIButton!
// TODO: Later, we'll re-enable the text message button // TODO: Later, we'll re-enable the text message button
// so users can send and read messages during a // so users can send and read messages during a
// call. // call.
@ -192,32 +192,32 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
action:#selector(didPressSpeakerphone)) action:#selector(didPressSpeakerphone))
hangUpButton = createButton(imageName:"hangup-active-wide", hangUpButton = createButton(imageName:"hangup-active-wide",
action:#selector(didPressHangup)) action:#selector(didPressHangup))
audioMuteButton = createButton(imageName:"mute-unselected-wide", audioModeMuteButton = createButton(imageName:"mute-unselected-wide",
action:#selector(didPressMute)) action:#selector(didPressMute))
videoMuteButton = createButton(imageName:"mute-unselected-wide", videoModeMuteButton = createButton(imageName:"mute-unselected-wide",
action:#selector(didPressMute)) action:#selector(didPressMute))
audioVideoButton = createButton(imageName:"video-inactive-wide", audioModeVideoButton = createButton(imageName:"video-inactive-wide",
action:#selector(didPressVideo)) action:#selector(didPressVideo))
videoVideoButton = createButton(imageName:"video-inactive-wide", videoModeVideoButton = createButton(imageName:"video-inactive-wide",
action:#selector(didPressVideo)) action:#selector(didPressVideo))
let muteSelectedImage = UIImage(named:"mute-selected-wide") let muteSelectedImage = UIImage(named:"mute-selected-wide")
assert(muteSelectedImage != nil) assert(muteSelectedImage != nil)
audioMuteButton.setImage(muteSelectedImage, for:.selected) audioModeMuteButton.setImage(muteSelectedImage, for:.selected)
videoMuteButton.setImage(muteSelectedImage, for:.selected) videoModeMuteButton.setImage(muteSelectedImage, for:.selected)
let videoSelectedImage = UIImage(named:"video-active-wide") let videoSelectedImage = UIImage(named:"video-active-wide")
assert(videoSelectedImage != nil) assert(videoSelectedImage != nil)
audioVideoButton.setImage(videoSelectedImage, for:.selected) audioModeVideoButton.setImage(videoSelectedImage, for:.selected)
videoVideoButton.setImage(videoSelectedImage, for:.selected) videoModeVideoButton.setImage(videoSelectedImage, for:.selected)
let speakerPhoneSelectedImage = UIImage(named:"speaker-active-wide") let speakerPhoneSelectedImage = UIImage(named:"speaker-active-wide")
assert(speakerPhoneSelectedImage != nil) assert(speakerPhoneSelectedImage != nil)
speakerPhoneButton.setImage(speakerPhoneSelectedImage, for:.selected) speakerPhoneButton.setImage(speakerPhoneSelectedImage, for:.selected)
ongoingCallView = createContainerForCallControls(controlGroups : [ ongoingCallView = createContainerForCallControls(controlGroups : [
[audioMuteButton, speakerPhoneButton, audioVideoButton ], [audioModeMuteButton, speakerPhoneButton, audioModeVideoButton ],
[videoMuteButton, hangUpButton, videoVideoButton ] [videoModeMuteButton, hangUpButton, videoModeVideoButton ]
]) ])
} }
@ -516,10 +516,10 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
assert(Thread.isMainThread) assert(Thread.isMainThread)
updateCallStatusLabel(callState: callState) updateCallStatusLabel(callState: callState)
audioMuteButton.isSelected = call.isMuted audioModeMuteButton.isSelected = call.isMuted
videoMuteButton.isSelected = call.isMuted videoModeMuteButton.isSelected = call.isMuted
audioVideoButton.isSelected = call.hasLocalVideo audioModeVideoButton.isSelected = call.hasLocalVideo
videoVideoButton.isSelected = call.hasLocalVideo videoModeVideoButton.isSelected = call.hasLocalVideo
speakerPhoneButton.isSelected = call.isSpeakerphoneEnabled speakerPhoneButton.isSelected = call.isSpeakerphoneEnabled
// Show Incoming vs. Ongoing call controls // Show Incoming vs. Ongoing call controls
@ -532,10 +532,10 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
// Rework control state if remote video is available. // Rework control state if remote video is available.
contactAvatarView.isHidden = !remoteVideoView.isHidden contactAvatarView.isHidden = !remoteVideoView.isHidden
speakerPhoneButton.isHidden = !remoteVideoView.isHidden speakerPhoneButton.isHidden = !remoteVideoView.isHidden
audioMuteButton.isHidden = !remoteVideoView.isHidden audioModeMuteButton.isHidden = !remoteVideoView.isHidden
videoMuteButton.isHidden = remoteVideoView.isHidden videoModeMuteButton.isHidden = remoteVideoView.isHidden
audioVideoButton.isHidden = !remoteVideoView.isHidden audioModeVideoButton.isHidden = !remoteVideoView.isHidden
videoVideoButton.isHidden = remoteVideoView.isHidden videoModeVideoButton.isHidden = remoteVideoView.isHidden
// Dismiss Handling // Dismiss Handling
switch callState { switch callState {
@ -630,8 +630,8 @@ class CallViewController: UIViewController, CallObserver, CallServiceObserver, R
func didPressVideo(sender: UIButton) { func didPressVideo(sender: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
let hasLocalVideo = !sender.isSelected let hasLocalVideo = !sender.isSelected
audioVideoButton.isSelected = hasLocalVideo audioModeVideoButton.isSelected = hasLocalVideo
videoVideoButton.isSelected = hasLocalVideo videoModeVideoButton.isSelected = hasLocalVideo
if let call = self.call { if let call = self.call {
callUIAdapter.setHasLocalVideo(call: call, hasLocalVideo: hasLocalVideo) callUIAdapter.setHasLocalVideo(call: call, hasLocalVideo: hasLocalVideo)
} else { } else {

Loading…
Cancel
Save