Skip to content

Commit 4b3e976

Browse files
babu-chilyaliao
andauthored
fix(useUserMedia): add deep watch to constraints (#5046)
Co-authored-by: IlyaL <[email protected]>
1 parent cf905cc commit 4b3e976

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/core/useUserMedia/demo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { videoInputs: cameras } = useDevicesList({
1313
1414
const video = useTemplateRef<HTMLVideoElement>('video')
1515
const { stream, enabled } = useUserMedia({
16-
constraints: reactive({ video: { deviceId: currentCamera } }),
16+
constraints: reactive({ video: { deviceId: { exact: currentCamera } } }),
1717
})
1818
1919
watchEffect(() => {

packages/core/useUserMedia/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function useUserMedia(options: UseUserMediaOptions = {}) {
106106
if (autoSwitch.value && stream.value)
107107
restart()
108108
},
109-
{ immediate: true },
109+
{ immediate: true, deep: true },
110110
)
111111

112112
tryOnScopeDispose(() => {

0 commit comments

Comments
 (0)