blob: 3953cd12fce7f2ba6187635939eeed9bc9220ba1 [file] [log] [blame]
<script>
let err = '';
function gotUserMedia(mediaStream)
{
window.webkit.messageHandlers.testHandler.postMessage('allowed');
}
function userMediaError(error)
{
err = `${error.name},${error.message}`;
window.webkit.messageHandlers.testHandler.postMessage('denied');
}
function lastError()
{
return err;
}
let constraints = { audio: false, video: true};
navigator.mediaDevices.getUserMedia(constraints)
.then(gotUserMedia).
catch(userMediaError);
</script>