|
@@ -89,8 +89,8 @@ class QmeraVideoViewController: UIViewController {
|
|
|
button.imageEdgeInsets = UIEdgeInsets(top: 2, left: 2, bottom: 2, right: 2)
|
|
|
button.contentVerticalAlignment = .fill
|
|
|
button.contentHorizontalAlignment = .fill
|
|
|
- button.frame.size.width = 30
|
|
|
- button.frame.size.height = 30
|
|
|
+// button.frame.size.width = 30
|
|
|
+// button.frame.size.height = 30
|
|
|
return button
|
|
|
}()
|
|
|
|
|
@@ -102,8 +102,8 @@ class QmeraVideoViewController: UIViewController {
|
|
|
button.imageEdgeInsets = UIEdgeInsets(top: 2, left: 2, bottom: 2, right: 2)
|
|
|
button.contentVerticalAlignment = .fill
|
|
|
button.contentHorizontalAlignment = .fill
|
|
|
- button.frame.size.width = 30
|
|
|
- button.frame.size.height = 30
|
|
|
+// button.frame.size.width = 30
|
|
|
+// button.frame.size.height = 30
|
|
|
return button
|
|
|
}()
|
|
|
|
|
@@ -143,6 +143,9 @@ class QmeraVideoViewController: UIViewController {
|
|
|
navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
|
|
|
navigationController?.changeAppearance(clear: true)
|
|
|
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(self.onStatusCall(_:)), name: NSNotification.Name(rawValue: "onStatusCall"), object: nil)
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(onReceiveMessage(notification:)), name: NSNotification.Name(rawValue: "onReceiveChat"), object: nil)
|
|
|
+
|
|
|
view.backgroundColor = .clear
|
|
|
navigationController?.navigationBar.topItem?.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
|
|
|
navigationController?.interactivePopGestureRecognizer?.isEnabled = false
|
|
@@ -159,8 +162,6 @@ class QmeraVideoViewController: UIViewController {
|
|
|
Calling()
|
|
|
addToolbar()
|
|
|
addTimerVC()
|
|
|
- NotificationCenter.default.addObserver(self, selector: #selector(self.onStatusCall(_:)), name: NSNotification.Name(rawValue: "onStatusCall"), object: nil)
|
|
|
- NotificationCenter.default.addObserver(self, selector: #selector(onReceiveMessage(notification:)), name: NSNotification.Name(rawValue: "onReceiveChat"), object: nil)
|
|
|
if isAutoAccept {
|
|
|
didTapAcceptCallButton()
|
|
|
}
|
|
@@ -229,7 +230,7 @@ class QmeraVideoViewController: UIViewController {
|
|
|
|
|
|
func addTimerVC() {
|
|
|
view.addSubview(containerTimerVC)
|
|
|
- containerTimerVC.anchor(top: view.topAnchor, paddingTop: 20, centerX: view.centerXAnchor, height: 30, minWidth: 40)
|
|
|
+ containerTimerVC.anchor(top: view.topAnchor, paddingTop: 20, centerX: view.centerXAnchor, minWidth: 40)
|
|
|
containerTimerVC.makeRoundedView(radius: 8)
|
|
|
containerTimerVC.backgroundColor = .black.withAlphaComponent(0.3)
|
|
|
containerTimerVC.addSubview(labelTimerVC)
|
|
@@ -364,6 +365,16 @@ class QmeraVideoViewController: UIViewController {
|
|
|
])
|
|
|
if isInisiator {
|
|
|
labelIncomingOutgoing.text = "Outgoing video call".localized() + "..."
|
|
|
+ if AVAudioSession.sharedInstance().category == .playAndRecord {
|
|
|
+ do {
|
|
|
+ try AVAudioSession.sharedInstance().setCategory(.soloAmbient)
|
|
|
+ // try AVAudioSession.sharedInstance().setMode(.default)
|
|
|
+ // try AVAudioSession.sharedInstance().overrideOutputAudioPort(.none)
|
|
|
+ } catch {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ print("AUDIO 1 \(AVAudioSession.sharedInstance().category)")
|
|
|
+ print("AUDIO 2 \(AVAudioSession.sharedInstance().mode)")
|
|
|
API.initiateCCall(sParty: dataPerson[0]["f_pin"]!, nCamIdx: 1, nResIdx: 2, nVQuality: 4, ivRemoteView: listRemoteViewFix, ivLocalView: cameraView, ivRemoteZ: zoomView)
|
|
|
} else {
|
|
|
let systemSoundID: SystemSoundID = 1254
|
|
@@ -492,22 +503,32 @@ class QmeraVideoViewController: UIViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @objc func didTapAcceptCallButton(){
|
|
|
- let goAudioCall = Nexilis.checkMicPermission()
|
|
|
- let goVideoCall = Nexilis.checkCameraPermission()
|
|
|
- if goVideoCall == 0 {
|
|
|
- let alert = UIAlertController(title: "Attention!".localized(), message: !goAudioCall && goVideoCall == 0 ? "Please allow microphone & camera permission in your settings".localized() : !goAudioCall ? "Please allow microphone permission in your settings".localized() : "Please allow camera permission in your settings", preferredStyle: .alert)
|
|
|
- alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {_ in
|
|
|
- if let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) {
|
|
|
- UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
|
|
+ @objc func didTapAcceptCallButton() {
|
|
|
+ if !isInisiator{
|
|
|
+ let goAudioCall = Nexilis.checkMicPermission()
|
|
|
+ let goVideoCall = Nexilis.checkCameraPermission()
|
|
|
+ if goVideoCall == 0 {
|
|
|
+ let alert = UIAlertController(title: "Attention!".localized(), message: !goAudioCall && goVideoCall == 0 ? "Please allow microphone & camera permission in your settings".localized() : !goAudioCall ? "Please allow microphone permission in your settings".localized() : "Please allow camera permission in your settings", preferredStyle: .alert)
|
|
|
+ alert.addAction(UIAlertAction(title: "OK".localized(), style: UIAlertAction.Style.default, handler: {_ in
|
|
|
+ if let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) {
|
|
|
+ UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ self.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
+ return
|
|
|
+ } else if goVideoCall == -1 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if AVAudioSession.sharedInstance().category == .playAndRecord {
|
|
|
+ do {
|
|
|
+ try AVAudioSession.sharedInstance().setCategory(.soloAmbient)
|
|
|
+ // try AVAudioSession.sharedInstance().setMode(.default)
|
|
|
+ // try AVAudioSession.sharedInstance().overrideOutputAudioPort(.none)
|
|
|
+ } catch {
|
|
|
}
|
|
|
- }))
|
|
|
- self.navigationController?.present(alert, animated: true, completion: nil)
|
|
|
- return
|
|
|
- } else if goVideoCall == -1 {
|
|
|
- return
|
|
|
+ }
|
|
|
+ API.receiveCCall(sParty: dataPerson[0]["f_pin"]!, nCamIdx: 1, nResIdx: 2, nVQuality: 4, ivRemoteView: listRemoteViewFix, ivLocalView: cameraView,ivRemoteZ: zoomView)
|
|
|
}
|
|
|
- API.receiveCCall(sParty: dataPerson[0]["f_pin"]!, nCamIdx: 1, nResIdx: 2, nVQuality: 4, ivRemoteView: listRemoteViewFix, ivLocalView: cameraView,ivRemoteZ: zoomView)
|
|
|
DispatchQueue.main.async {
|
|
|
self.myImage.removeFromSuperview()
|
|
|
self.name.removeFromSuperview()
|
|
@@ -697,7 +718,6 @@ class QmeraVideoViewController: UIViewController {
|
|
|
NSLayoutConstraint.activate([
|
|
|
constraintRightPowered,
|
|
|
constraintBottomPowered,
|
|
|
- poweredByView.heightAnchor.constraint(equalToConstant: 40.0),
|
|
|
nexilisLogo.widthAnchor.constraint(equalToConstant: 30.0),
|
|
|
nexilisLogo.heightAnchor.constraint(equalToConstant: 30.0)
|
|
|
])
|
|
@@ -856,12 +876,7 @@ class QmeraVideoViewController: UIViewController {
|
|
|
let channel = arrayMessage[arrayMessage.count - 1]
|
|
|
if(remoteChannel[String(channel)] != "2"){
|
|
|
DispatchQueue.main.async {
|
|
|
- if(arrayMessage[arrayMessage.count - 2] == "0"){ // back camera
|
|
|
- self.zoomView.transform = CGAffineTransform.init(scaleX: 1.9, y: 1.9).rotated(by: (CGFloat.pi)/2)
|
|
|
- }
|
|
|
- else { // front camera
|
|
|
- self.zoomView.transform = CGAffineTransform.init(scaleX: -1.9, y: 1.9).rotated(by: (CGFloat.pi * 3)/2)
|
|
|
- }
|
|
|
+ self.zoomView.transform = CGAffineTransform.init(scaleX: 1.9, y: 1.9).rotated(by: (CGFloat.pi)/2)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1020,7 +1035,7 @@ class QmeraVideoViewController: UIViewController {
|
|
|
self.wbTimer.invalidate()
|
|
|
_ = Nexilis.getWhiteboardDelegate()?.terminate()
|
|
|
}
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
|
|
self.endAllCall()
|
|
|
self.dismiss(animated: true, completion: nil)
|
|
|
}
|
|
@@ -1061,7 +1076,7 @@ class QmeraVideoViewController: UIViewController {
|
|
|
if controller != nil {
|
|
|
controller!.dismiss(animated: true)
|
|
|
}
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
|
|
self.endAllCall()
|
|
|
if self.isInisiator {
|
|
|
self.navigationController?.popViewController(animated: true)
|
|
@@ -1160,7 +1175,7 @@ class QmeraVideoViewController: UIViewController {
|
|
|
}
|
|
|
}
|
|
|
if (self.dataPerson.count == 1) {
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
|
|
self.endAllCall()
|
|
|
if self.isInisiator && onGoingCC.isEmpty {
|
|
|
self.navigationController?.popViewController(animated: true)
|
|
@@ -1223,7 +1238,7 @@ class QmeraVideoViewController: UIViewController {
|
|
|
}
|
|
|
}
|
|
|
if (self.dataPerson.count == 1) {
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
|
|
self.endAllCall()
|
|
|
if self.isInisiator && onGoingCC.isEmpty {
|
|
|
self.navigationController?.popViewController(animated: true)
|