File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -197,11 +197,13 @@ open class LocalMedia: ObservableObject {
197197 /// Selects a video capture device.
198198 /// - Parameter videoDevice: The ``AVCaptureDevice`` to select.
199199 public func select( videoDevice: AVCaptureDevice ) async {
200- selectedVideoDeviceID = videoDevice. uniqueID
201-
202200 guard let cameraCapturer = getCameraCapturer ( ) else { return }
203- let captureOptions = CameraCaptureOptions ( device: videoDevice)
204- _ = try ? await cameraCapturer. set ( options: captureOptions)
201+ do {
202+ try await cameraCapturer. set ( options: . init( device: videoDevice) )
203+ selectedVideoDeviceID = videoDevice. uniqueID
204+ } catch {
205+ self . error = . mediaDevice( error)
206+ }
205207 }
206208
207209 /// Switches the camera position.
You can’t perform that action at this time.
0 commit comments