Skip to content

Commit

Permalink
fix crash on stop capture
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloszFilimowski committed Jan 14, 2025
1 parent ee10165 commit c2a6f95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ class FishjamClientInternal {

func leave(onLeave: (() -> Void)? = nil) {
rtcEngineCommunication.disconnect()
for track in localEndpoint.tracks.values {
if let track = track as? LocalTrack {
track.stop()
}
}
peerConnectionManager.close()
localEndpoint = Endpoint(id: "")
remoteEndpointsMap = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CameraCapturer: VideoCapturer {

init(videoParameters: VideoParameters, delegate: RTCVideoCapturerDelegate, deviceId: String? = nil) {
self.videoParameters = videoParameters
self.capturer = RTCCameraVideoCapturer(delegate: delegate)
self.capturer = RTCCameraVideoCapturer(delegate: delegate, captureSession: AVCaptureSession())
let devices = RTCCameraVideoCapturer.captureDevices()

if let newDevice = devices.first(where: { $0.uniqueID == deviceId }) {
Expand All @@ -28,7 +28,7 @@ class CameraCapturer: VideoCapturer {
}

public func stopCapture() {
self.capturer.stopCapture()
capturer.stopCapture()
}

public func switchCamera() {
Expand Down

0 comments on commit c2a6f95

Please sign in to comment.