We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
granted
1 parent 9ba07a2 commit f968553Copy full SHA for f968553
packages/core/useDevicesList/index.ts
@@ -73,13 +73,15 @@ export function useDevicesList(options: UseDevicesListOptions = {}): UseDevicesL
73
}
74
75
async function ensurePermissions() {
76
+ const deviceName = constraints.video ? 'camera' : 'microphone'
77
+
78
if (!isSupported.value)
79
return false
80
81
if (permissionGranted.value)
82
return true
83
- const { state, query } = usePermission('camera', { controls: true })
84
+ const { state, query } = usePermission(deviceName, { controls: true })
85
await query()
86
if (state.value !== 'granted') {
87
let granted = true
0 commit comments