blob: 580c86f472e233105bdadf4684c2558c58ad8681 [file] [log] [blame]
<script>
async function enumerate(event)
{
let devices = await navigator.mediaDevices.enumerateDevices();
let visible = devices.map(device => device.kind.indexOf('video') == 0 ? 'camera' : 'microphone').sort();
visible = visible.join('+');
parent.postMessage(`${event.data}:${visible}`, '*');
result.innerHTML = visible;
}
window.addEventListener("message", (id) => enumerate(id));
</script>
<div id='result'></div>