8000 [iOS] stop capture RTCVideoSource if it been opened before · ened/flutter-webrtc@ad572b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad572b6

Browse files
committed
[iOS] stop capture RTCVideoSource if it been opened before
for more details see the conversation - flutter-webrtc#228
1 parent 5fac998 commit ad572b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ios/Classes/FlutterRTCMediaStream.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ - (void)getUserVideo:(NSDictionary *)constraints
291291

292292
if (videoDevice) {
293293
RTCVideoSource *videoSource = [self.peerConnectionFactory videoSource];
294+
if (self.videoCapturer) {
295+
[self.videoCapturer stopCapture];
296+
}
294297
self.videoCapturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:videoSource];
295298
AVCaptureDeviceFormat *selectedFormat = [self selectFormatForDevice:videoDevice];
296299
NSInteger selectedFps = [self selectFpsForFormat:selectedFormat];

0 commit comments

Comments
 (0)
0