AppRTCDemo(iOS): now works in the iOS Simulator!

...which has no camera device emulation or pass-through, so no local video
view.

R=noahric@google.com

Review URL: https://webrtc-codereview.appspot.com/10919004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5815 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org 2014-03-31 20:22:19 +00:00
parent 61e78fca6c
commit 49c5ba32bb
2 changed files with 9 additions and 1 deletions

View File

@ -142,6 +142,8 @@ class CallbackConverter : public webrtc::VideoRendererInterface {
}
- (void)stop {
[_activityIndicator stopAnimating];
[_activityIndicator removeFromSuperview];
_iosRenderer->StopRender();
}

View File

@ -247,6 +247,11 @@
RTCMediaStream* lms =
[self.peerConnectionFactory mediaStreamWithLabel:@"ARDAMS"];
// The iOS simulator doesn't provide any sort of camera capture
// support or emulation (http://goo.gl/rHAnC1) so don't bother
// trying to open a local stream.
RTCVideoTrack* localVideoTrack;
#if !TARGET_IPHONE_SIMULATOR
NSString* cameraID = nil;
for (AVCaptureDevice* captureDevice in
[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
@ -262,12 +267,13 @@
self.videoSource = [self.peerConnectionFactory
videoSourceWithCapturer:capturer
constraints:self.client.videoConstraints];
RTCVideoTrack* localVideoTrack =
localVideoTrack =
[self.peerConnectionFactory videoTrackWithID:@"ARDAMSv0"
source:self.videoSource];
if (localVideoTrack) {
[lms addVideoTrack:localVideoTrack];
}
#endif
[self.viewController.localVideoView
renderVideoTrackInterface:localVideoTrack];