From df13ce3da9bc59192609e5d272f1069c3b429ea7 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Wed, 17 Feb 2021 16:49:48 +0300 Subject: [PATCH] Remove PiP button callback --- Riot/Managers/Call/CallPresenter.swift | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/Riot/Managers/Call/CallPresenter.swift b/Riot/Managers/Call/CallPresenter.swift index 8185e7c8f..81dbf995f 100644 --- a/Riot/Managers/Call/CallPresenter.swift +++ b/Riot/Managers/Call/CallPresenter.swift @@ -478,8 +478,13 @@ extension CallPresenter: MXKCallViewControllerDelegate { // wait for the call state changes, will be handled there return } else { - dismissCallVC(callVC) - self.presentCallBar(for: callVC, completion: completion) + if callVC.mxCall.isVideoCall { + // go to pip mode here + enterPipCallVC(callVC, completion: completion) + } else { + dismissCallVC(callVC) + self.presentCallBar(for: callVC, completion: completion) + } } } @@ -501,20 +506,6 @@ extension CallPresenter: MXKCallViewControllerDelegate { presentCallVC(onHoldCallVC) } - func callViewControllerDidTapPiPButton(_ callViewController: MXKCallViewController!) { - guard let callVC = callViewController as? CallViewController else { - // this call screen is not handled by this service - return - } - - // sanity check - // do not enter PiP mode if not a video call - guard callVC.mxCall.isVideoCall else { return } - - // go to pip mode here - enterPipCallVC(callVC) - } - } // MARK: - UIViewControllerTransitioningDelegate