8000 Merge pull request #228 from artsector/master · hicodeboy/flutter-webrtc@a799fc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit a799fc7

Browse files
authored
Merge pull request flutter-webrtc#228 from artsector/master
[macOS] Fix hot restart videoCapturer crash
2 parents bc8dc67 + 5fac998 commit a799fc7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

macos/Classes/FlutterRTCMediaStream.m

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

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

0 commit comments

Comments
 (0)
0