I have this piece of code which takes input the the camera and displays it within the web browser window (works only if served from a web server, not directly by opening a file):
<html>
<body>
<video id="video" width="640" height="480" autoplay="true"></video>
<script>
var video = document.getElementById('video');
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({video: true}).then(function (stream) {
video.src = window.URL.createObjectURL(stream);
video.play();
});
}
</script>
</body>
</html>
I'd like to live-stream the video it to a URL (example: to "/publish/?password=" as in https://github.com/vbence/stream-m)
How do I code that?
Thanks!