Skip to content

Instantly share code, notes, and snippets.

@polatengin
Created October 9, 2016 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polatengin/104d28edab721668a7315bc27943ae0a to your computer and use it in GitHub Desktop.
Save polatengin/104d28edab721668a7315bc27943ae0a to your computer and use it in GitHub Desktop.
HTML5 video element ile cihazın Camera görüntüsünü göstermek
<!doctype html>
<html lang="tr">
<head>
<title>Video Camera</title>
<meta charset="utf-8" />
</head>
<body>
</body>
</html>
{
video: {
mandatory: {
minWidth: 1280,
minHeight: 720
}
}
}
<video id="cameraPlayer" autoplay></video>
<script>
if (navigator.getUserMedia) {
navigator.getUserMedia({ video:true, audio:false }, function(stream) {
var output = document.getElementById(‘cameraPlayer’);
output.src = window.URL.createObjectURL(stream);
}, function(error) {});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment