I'm pretty new to all of this (javascript especially, aka copy/paste and reverse engineering is my friend), my background is VoIP, I have found this as a way to turn off the camera - It works on my MacBook running Canary Version 20.0.1111.1 canary.
<!Doctype html>
<html>
<head>
<title>index</title>
</head>
<body>
<input type="button" value="Start" onclick="showVideo()" id="showVideo">
<input type="button" value="Stop" onclick="stopVideo()" id="stopVideo">
<video id="video" autoplay>No video</video>
<script>
showVideo = function()
{
navigator.webkitGetUserMedia("video",
function(stream)
{
var video = document.getElementById("video");
video.src = window.webkitURL.createObjectURL(stream);
}
);
}
stopVideo = function()
{
navigator.webkitGetUserMedia("video",
function(stream)
{
var video = document.getElementById("video");
video.src = window.webkitURL.createObjectURL(null);
}
);
}
</script>
</body>
</html>