Index: webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m |
diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m |
index 2241930d4736e53523f73e28addcecadd43a8030..98ef6349dd6e426ee085cc0808bc8ee4ebf72151 100644 |
--- a/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m |
+++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDVideoCallView.m |
@@ -30,6 +30,7 @@ static CGFloat const kStatusBarHeight = 20; |
UIButton *_routeChangeButton; |
UIButton *_cameraSwitchButton; |
UIButton *_hangupButton; |
+ UIButton *_debugButton; |
CGSize _remoteVideoSize; |
} |
@@ -94,6 +95,16 @@ static CGFloat const kStatusBarHeight = 20; |
forControlEvents:UIControlEventTouchUpInside]; |
[self addSubview:_hangupButton]; |
+ _debugButton = [UIButton buttonWithType:UIButtonTypeSystem]; |
+ _debugButton.backgroundColor = [UIColor whiteColor]; |
+ _debugButton.layer.cornerRadius = kButtonSize / 2; |
+ _debugButton.layer.masksToBounds = YES; |
+ [_debugButton setTitle:@"Debug" forState:UIControlStateNormal]; |
+ [_debugButton addTarget:self |
+ action:@selector(onDebug:) |
+ forControlEvents:UIControlEventTouchUpInside]; |
+ [self addSubview:_debugButton]; |
+ |
_statusLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
_statusLabel.font = [UIFont fontWithName:@"Roboto" size:16]; |
_statusLabel.textColor = [UIColor whiteColor]; |
@@ -168,6 +179,12 @@ static CGFloat const kStatusBarHeight = 20; |
CGRectGetMaxX(routeChangeFrame) + kButtonPadding; |
_routeChangeButton.frame = routeChangeFrame; |
+ // Place debug button above hangup button. |
+ CGRect debugButtonFrame = _hangupButton.frame; |
+ debugButtonFrame.origin.y = |
+ CGRectGetMinY(debugButtonFrame) - CGRectGetHeight(_hangupButton.frame) - kButtonPadding; |
+ _debugButton.frame = debugButtonFrame; |
+ |
[_statusLabel sizeToFit]; |
_statusLabel.center = |
CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)); |
@@ -196,6 +213,10 @@ static CGFloat const kStatusBarHeight = 20; |
[_delegate videoCallViewDidHangup:self]; |
} |
+- (void)onDebug:(id)sender { |
+ [_delegate videoCallViewDidDebug:self]; |
+} |
+ |
- (void)didTripleTap:(UITapGestureRecognizer *)recognizer { |
[_delegate videoCallViewDidEnableStats:self]; |
} |