Vue hook that tracks connected hardware devices.
import { createComponent } from '@vue/composition-api'
import { useMediaDevices } from 'vuses'
const Demo = createComponent({
setup() {
const devices = useMediaDevices()
return { devices }
},
render() {
const { devices } = this
return <pre>{JSON.stringify(devices, null, 2)}</pre>
}
})
function useMediaDevices(): Partial<MediaDeviceInfo>[]