From 49c5ba32bb885918cb6801d2ab47f29380bad67f Mon Sep 17 00:00:00 2001 From: "fischman@webrtc.org" Date: Mon, 31 Mar 2014 20:22:19 +0000 Subject: [PATCH] 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 --- talk/app/webrtc/objc/RTCVideoRenderer.mm | 2 ++ talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/talk/app/webrtc/objc/RTCVideoRenderer.mm b/talk/app/webrtc/objc/RTCVideoRenderer.mm index f6eef1c0b..be3d2051b 100644 --- a/talk/app/webrtc/objc/RTCVideoRenderer.mm +++ b/talk/app/webrtc/objc/RTCVideoRenderer.mm @@ -142,6 +142,8 @@ class CallbackConverter : public webrtc::VideoRendererInterface { } - (void)stop { + [_activityIndicator stopAnimating]; + [_activityIndicator removeFromSuperview]; _iosRenderer->StopRender(); } diff --git a/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m b/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m index e8077b962..e25181672 100644 --- a/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m +++ b/talk/examples/ios/AppRTCDemo/APPRTCAppDelegate.m @@ -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];