@stream-io/video-react-sdk 1.19.5 → 1.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs.js +11 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -8
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/usePersistedDevicePreferences.ts +10 -7
package/package.json
CHANGED
|
@@ -59,13 +59,16 @@ export const usePersistedDevicePreferences = (
|
|
|
59
59
|
'idle' | 'applying' | 'applied'
|
|
60
60
|
>('idle');
|
|
61
61
|
|
|
62
|
+
// when the camera is disabled on call type level, we should discard
|
|
63
|
+
// any stored camera preferences.
|
|
64
|
+
const cameraDevices = settings?.video?.enabled ? cameraState.devices : false;
|
|
62
65
|
useEffect(
|
|
63
66
|
function apply() {
|
|
64
67
|
if (
|
|
65
68
|
callingState === CallingState.LEFT ||
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
microphoneState.devices.length === 0 ||
|
|
70
|
+
(Array.isArray(cameraDevices) && cameraDevices.length === 0) ||
|
|
71
|
+
speakerState.devices.length === 0 ||
|
|
69
72
|
!settings ||
|
|
70
73
|
applyingState !== 'idle'
|
|
71
74
|
) {
|
|
@@ -91,7 +94,7 @@ export const usePersistedDevicePreferences = (
|
|
|
91
94
|
? applyLocalDevicePreference(
|
|
92
95
|
manager,
|
|
93
96
|
[preference].flat(),
|
|
94
|
-
state.devices,
|
|
97
|
+
deviceKey === 'camera' ? cameraDevices || [] : state.devices,
|
|
95
98
|
enabledInCallType,
|
|
96
99
|
)
|
|
97
100
|
: applyMutedState(manager, defaultMuted, enabledInCallType);
|
|
@@ -111,7 +114,7 @@ export const usePersistedDevicePreferences = (
|
|
|
111
114
|
applyingState,
|
|
112
115
|
callingState,
|
|
113
116
|
cameraState,
|
|
114
|
-
|
|
117
|
+
cameraDevices,
|
|
115
118
|
key,
|
|
116
119
|
microphoneState,
|
|
117
120
|
microphoneState.devices,
|
|
@@ -130,7 +133,7 @@ export const usePersistedDevicePreferences = (
|
|
|
130
133
|
for (const [deviceKey, devices, selectedDevice, isMute] of [
|
|
131
134
|
[
|
|
132
135
|
'camera',
|
|
133
|
-
|
|
136
|
+
cameraDevices || [],
|
|
134
137
|
cameraState.selectedDevice,
|
|
135
138
|
cameraState.isMute,
|
|
136
139
|
],
|
|
@@ -161,7 +164,7 @@ export const usePersistedDevicePreferences = (
|
|
|
161
164
|
[
|
|
162
165
|
applyingState,
|
|
163
166
|
callingState,
|
|
164
|
-
|
|
167
|
+
cameraDevices,
|
|
165
168
|
cameraState.isMute,
|
|
166
169
|
cameraState.selectedDevice,
|
|
167
170
|
key,
|