From a56df6dca19dd4096a186dd9d795d7adc8e07c76 Mon Sep 17 00:00:00 2001 From: Brazol Date: Tue, 3 Dec 2024 14:07:58 +0100 Subject: [PATCH] tweaks --- packages/stream_video/lib/src/call/call.dart | 8 +++++--- .../stream_video/lib/src/call/session/call_session.dart | 8 ++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/stream_video/lib/src/call/call.dart b/packages/stream_video/lib/src/call/call.dart index 068b20bb..0efbca9d 100644 --- a/packages/stream_video/lib/src/call/call.dart +++ b/packages/stream_video/lib/src/call/call.dart @@ -1402,16 +1402,16 @@ class Call { _logger.v(() => '[applyConnectOptions] finished'); } - Future _applyCameraOption( + Future> _applyCameraOption( TrackOption cameraOption, FacingMode facingMode, StreamTargetResolution? targetResolution, String? deviceId, ) async { if (cameraOption is TrackProvided) { - await _setLocalTrack(cameraOption.track); + return _setLocalTrack(cameraOption.track); } else if (cameraOption is TrackEnabled) { - await setCameraEnabled( + return setCameraEnabled( enabled: true, constraints: CameraConstraints( facingMode: facingMode, @@ -1421,6 +1421,8 @@ class Call { ), ); } + + return const Result.success(none); } Future _applyMicrophoneOption(TrackOption microphoneOption) async { diff --git a/packages/stream_video/lib/src/call/session/call_session.dart b/packages/stream_video/lib/src/call/session/call_session.dart index 082d7f16..5d2086cd 100644 --- a/packages/stream_video/lib/src/call/session/call_session.dart +++ b/packages/stream_video/lib/src/call/session/call_session.dart @@ -922,13 +922,17 @@ class CallSession extends Disposable { final audioInputDevices = sfu_models.InputDevices( availableDevices: _availableAudioInputs, currentDevice: stateManager.callState.audioInputDevice?.label, - isPermitted: stateManager.callState.audioInputDevice != null, + isPermitted: stateManager.callState.audioInputDevice != null && + stateManager.callState.ownCapabilities + .contains(CallPermission.sendAudio), ); final videoInputDevices = sfu_models.InputDevices( availableDevices: _availableVideoInputs, currentDevice: stateManager.callState.videoInputDevice?.label, - isPermitted: stateManager.callState.videoInputDevice != null, + isPermitted: stateManager.callState.videoInputDevice != null && + stateManager.callState.ownCapabilities + .contains(CallPermission.sendVideo), ); if (CurrentPlatform.isAndroid) {