Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m

Issue 2777983004: iOS:Add loopback launch argument functionality in AppRTCMobile. (Closed)
Patch Set: Use static const instead of hardcoded value Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/ios/ARDMainView.m ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m
diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m
index 593c6a27f81893df92fc1338eb193d6b2ab67630..75d454a44c3a1372dc4761ade72cbb9f4ca78b7c 100644
--- a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m
+++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m
@@ -25,6 +25,9 @@
static NSString *const barButtonImageString = @"ic_settings_black_24dp.png";
+// Launch argument to be passed to indicate that the app should start loopback immediatly
+static NSString *const loopbackLaunchProcessArgument = @"loopback";
+
@interface ARDMainViewController () <
ARDMainViewDelegate,
ARDVideoCallViewControllerDelegate,
@@ -37,6 +40,19 @@ static NSString *const barButtonImageString = @"ic_settings_black_24dp.png";
BOOL _useManualAudio;
}
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ if ([[[NSProcessInfo processInfo] arguments] containsObject:loopbackLaunchProcessArgument]) {
+ [self mainView:nil
+ didInputRoom:@""
+ isLoopback:YES
+ isAudioOnly:NO
+ shouldMakeAecDump:NO
+ shouldUseLevelControl:NO
+ useManualAudio:NO];
+ }
+}
+
- (void)loadView {
self.title = @"AppRTC Mobile";
_mainView = [[ARDMainView alloc] initWithFrame:CGRectZero];
@@ -66,6 +82,12 @@ static NSString *const barButtonImageString = @"ic_settings_black_24dp.png";
self.navigationItem.rightBarButtonItem = settingsButton;
}
++ (NSString *)loopbackRoomString {
+ NSString *loopbackRoomString =
+ [[NSUUID UUID].UUIDString stringByReplacingOccurrencesOfString:@"-" withString:@""];
+ return loopbackRoomString;
+}
+
#pragma mark - ARDMainViewDelegate
- (void)mainView:(ARDMainView *)mainView
@@ -76,8 +98,13 @@ static NSString *const barButtonImageString = @"ic_settings_black_24dp.png";
shouldUseLevelControl:(BOOL)shouldUseLevelControl
useManualAudio:(BOOL)useManualAudio {
if (!room.length) {
- [self showAlertWithMessage:@"Missing room name."];
- return;
+ if (isLoopback) {
+ // If this is a loopback call, allow a generated room name.
+ room = [[self class] loopbackRoomString];
+ } else {
+ [self showAlertWithMessage:@"Missing room name."];
+ return;
+ }
}
// Trim whitespaces.
NSCharacterSet *whitespaceSet = [NSCharacterSet whitespaceCharacterSet];
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/ios/ARDMainView.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698