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

Side by Side Diff: webrtc/examples/objc/AppRTCDemo/ios/ARDMainViewController.m

Issue 2294913003: Update iOS AppRTCDemo to use level controller. (Closed)
Patch Set: Remove blank line. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 RTCAudioSession *session = [RTCAudioSession sharedInstance]; 47 RTCAudioSession *session = [RTCAudioSession sharedInstance];
48 [session addDelegate:self]; 48 [session addDelegate:self];
49 49
50 [self configureAudioSession]; 50 [self configureAudioSession];
51 [self setupAudioPlayer]; 51 [self setupAudioPlayer];
52 } 52 }
53 53
54 #pragma mark - ARDMainViewDelegate 54 #pragma mark - ARDMainViewDelegate
55 55
56 - (void)mainView:(ARDMainView *)mainView 56 - (void)mainView:(ARDMainView *)mainView
57 didInputRoom:(NSString *)room 57 didInputRoom:(NSString *)room
58 isLoopback:(BOOL)isLoopback 58 isLoopback:(BOOL)isLoopback
59 isAudioOnly:(BOOL)isAudioOnly 59 isAudioOnly:(BOOL)isAudioOnly
60 shouldMakeAecDump:(BOOL)shouldMakeAecDump 60 shouldMakeAecDump:(BOOL)shouldMakeAecDump
61 useManualAudio:(BOOL)useManualAudio { 61 shouldUseLevelControl:(BOOL)shouldUseLevelControl
62 useManualAudio:(BOOL)useManualAudio {
62 if (!room.length) { 63 if (!room.length) {
63 [self showAlertWithMessage:@"Missing room name."]; 64 [self showAlertWithMessage:@"Missing room name."];
64 return; 65 return;
65 } 66 }
66 // Trim whitespaces. 67 // Trim whitespaces.
67 NSCharacterSet *whitespaceSet = [NSCharacterSet whitespaceCharacterSet]; 68 NSCharacterSet *whitespaceSet = [NSCharacterSet whitespaceCharacterSet];
68 NSString *trimmedRoom = [room stringByTrimmingCharactersInSet:whitespaceSet]; 69 NSString *trimmedRoom = [room stringByTrimmingCharactersInSet:whitespaceSet];
69 70
70 // Check that room name is valid. 71 // Check that room name is valid.
71 NSError *error = nil; 72 NSError *error = nil;
(...skipping 19 matching lines...) Expand all
91 RTCAudioSession *session = [RTCAudioSession sharedInstance]; 92 RTCAudioSession *session = [RTCAudioSession sharedInstance];
92 session.useManualAudio = useManualAudio; 93 session.useManualAudio = useManualAudio;
93 session.isAudioEnabled = NO; 94 session.isAudioEnabled = NO;
94 95
95 // Kick off the video call. 96 // Kick off the video call.
96 ARDVideoCallViewController *videoCallViewController = 97 ARDVideoCallViewController *videoCallViewController =
97 [[ARDVideoCallViewController alloc] initForRoom:trimmedRoom 98 [[ARDVideoCallViewController alloc] initForRoom:trimmedRoom
98 isLoopback:isLoopback 99 isLoopback:isLoopback
99 isAudioOnly:isAudioOnly 100 isAudioOnly:isAudioOnly
100 shouldMakeAecDump:shouldMakeAecDump 101 shouldMakeAecDump:shouldMakeAecDump
102 shouldUseLevelControl:shouldUseLevelControl
101 delegate:self]; 103 delegate:self];
102 videoCallViewController.modalTransitionStyle = 104 videoCallViewController.modalTransitionStyle =
103 UIModalTransitionStyleCrossDissolve; 105 UIModalTransitionStyleCrossDissolve;
104 [self presentViewController:videoCallViewController 106 [self presentViewController:videoCallViewController
105 animated:YES 107 animated:YES
106 completion:nil]; 108 completion:nil];
107 } 109 }
108 110
109 - (void)mainViewDidToggleAudioLoop:(ARDMainView *)mainView { 111 - (void)mainViewDidToggleAudioLoop:(ARDMainView *)mainView {
110 if (mainView.isAudioLoopPlaying) { 112 if (mainView.isAudioLoopPlaying) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 - (void)showAlertWithMessage:(NSString*)message { 202 - (void)showAlertWithMessage:(NSString*)message {
201 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil 203 UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:nil
202 message:message 204 message:message
203 delegate:nil 205 delegate:nil
204 cancelButtonTitle:@"OK" 206 cancelButtonTitle:@"OK"
205 otherButtonTitles:nil]; 207 otherButtonTitles:nil];
206 [alertView show]; 208 [alertView show];
207 } 209 }
208 210
209 @end 211 @end
OLDNEW
« no previous file with comments | « webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.m ('k') | webrtc/examples/objc/AppRTCDemo/ios/ARDVideoCallViewController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698