mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 11:30:50 +02:00
Add pip view container and load pip view into it
This commit is contained in:
@@ -37,8 +37,11 @@
|
||||
BOOL promptForStunServerFallback;
|
||||
}
|
||||
|
||||
@property (nonatomic, weak) IBOutlet UIView *pipViewContainer;
|
||||
|
||||
@property (nonatomic, strong) id<Theme> overriddenTheme;
|
||||
@property (nonatomic, assign) BOOL inPiP;
|
||||
@property (nonatomic, strong) CallPiPView *pipView;
|
||||
|
||||
@property (nonatomic, strong) CustomSizedPresentationController *customSizedPresentationController;
|
||||
|
||||
@@ -224,6 +227,8 @@
|
||||
- (void)call:(MXCall *)call stateDidChange:(MXCallState)state reason:(MXEvent *)event
|
||||
{
|
||||
[super call:call stateDidChange:state reason:event];
|
||||
|
||||
[self configurePiPView];
|
||||
|
||||
[self checkStunServerFallbackWithCallState:state];
|
||||
}
|
||||
@@ -379,6 +384,22 @@
|
||||
return _overriddenTheme;
|
||||
}
|
||||
|
||||
- (CallPiPView *)pipView
|
||||
{
|
||||
if (_pipView == nil)
|
||||
{
|
||||
_pipView = [CallPiPView instantiateWithSession:self.mainSession];
|
||||
}
|
||||
return _pipView;
|
||||
}
|
||||
|
||||
- (void)setMxCallOnHold:(MXCall *)mxCallOnHold
|
||||
{
|
||||
[super setMxCallOnHold:mxCallOnHold];
|
||||
|
||||
[self configurePiPView];
|
||||
}
|
||||
|
||||
- (UIImage*)picturePlaceholder
|
||||
{
|
||||
CGFloat fontSize = floor(self.callerImageViewWidthConstraint.constant * 0.7);
|
||||
@@ -502,9 +523,17 @@
|
||||
self.callStatusLabel.hidden = YES;
|
||||
self.localPreviewContainerView.hidden = YES;
|
||||
self.localPreviewActivityView.hidden = YES;
|
||||
|
||||
if (self.pipViewContainer.subviews.count == 0)
|
||||
{
|
||||
[self.pipViewContainer vc_addSubViewMatchingParent:self.pipView];
|
||||
[self configurePiPView];
|
||||
}
|
||||
self.pipViewContainer.hidden = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.pipViewContainer.hidden = YES;
|
||||
self.localPreviewContainerView.hidden = NO;
|
||||
self.callerImageView.hidden = NO;
|
||||
self.callerNameLabel.hidden = NO;
|
||||
@@ -644,6 +673,19 @@
|
||||
[viewController dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - PiP
|
||||
|
||||
- (void)configurePiPView
|
||||
{
|
||||
if (self.inPiP)
|
||||
{
|
||||
[self.pipView configureWithCall:self.mxCall
|
||||
peer:self.peer
|
||||
onHoldCall:self.mxCallOnHold
|
||||
onHoldPeer:self.peerOnHold];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - PictureInPicturable
|
||||
|
||||
- (void)enterPiP
|
||||
|
||||
Reference in New Issue
Block a user