OLD | NEW |
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 #pragma mark - RTCAudioSessionDelegate | 163 #pragma mark - RTCAudioSessionDelegate |
164 | 164 |
165 - (void)audioSessionDidStartPlayOrRecord:(RTCAudioSession *)session { | 165 - (void)audioSessionDidStartPlayOrRecord:(RTCAudioSession *)session { |
166 // Stop playback on main queue and then configure WebRTC. | 166 // Stop playback on main queue and then configure WebRTC. |
167 [RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeMain | 167 [RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeMain |
168 block:^{ | 168 block:^{ |
169 if (_mainView.isAudioLoopPlaying) { | 169 if (_mainView.isAudioLoopPlaying) { |
170 RTCLog(@"Stopping audio loop due to WebRTC start."); | 170 RTCLog(@"Stopping audio loop due to WebRTC start."); |
171 [_audioPlayer stop]; | 171 [_audioPlayer stop]; |
172 } | 172 } |
173 RTCLog(@"Setting isAudioEnabled to YES."); | 173 // RTCLog(@"Setting isAudioEnabled to YES."); |
174 session.isAudioEnabled = YES; | 174 // session.isAudioEnabled = YES; |
175 }]; | 175 }]; |
176 } | 176 } |
177 | 177 |
178 - (void)audioSessionDidStopPlayOrRecord:(RTCAudioSession *)session { | 178 - (void)audioSessionDidStopPlayOrRecord:(RTCAudioSession *)session { |
179 // WebRTC is done with the audio session. Restart playback. | 179 // WebRTC is done with the audio session. Restart playback. |
180 [RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeMain | 180 [RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeMain |
181 block:^{ | 181 block:^{ |
182 RTCLog(@"audioSessionDidStopPlayOrRecord"); | 182 RTCLog(@"audioSessionDidStopPlayOrRecord"); |
183 [self restartAudioPlayerIfNeeded]; | 183 [self restartAudioPlayerIfNeeded]; |
184 }]; | 184 }]; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" | 251 UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" |
252 style:UIAlertActionSty
leDefault | 252 style:UIAlertActionSty
leDefault |
253 handler:^(UIAlertAction
*action){ | 253 handler:^(UIAlertAction
*action){ |
254 }]; | 254 }]; |
255 | 255 |
256 [alert addAction:defaultAction]; | 256 [alert addAction:defaultAction]; |
257 [self presentViewController:alert animated:YES completion:nil]; | 257 [self presentViewController:alert animated:YES completion:nil]; |
258 } | 258 } |
259 | 259 |
260 @end | 260 @end |
OLD | NEW |