<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<video id="video1" autoplay></video>
<script>
navigator.mediaDevices.getUserMedia({ video: true }).then(function (stream) {
let video1 = document.getElementById('video1');
video1.src = window.URL.createObjectURL(stream);
video1.onloadedmetadata = function(e) {
// 特別な処理をここで
console.log(e);
};
}).catch(function(e) { console.log(e.name); });
</script>
</body>
</html>
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
10