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