
Review URL: https://webrtc-codereview.appspot.com/1126005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3578 4adac7df-926f-26a2-2b94-8c16560cd09d
34 lines
595 B
HTML
34 lines
595 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>getUserMedia Demo 1</title>
|
|
<style>
|
|
video {
|
|
border:5px solid black;
|
|
width:480px;
|
|
height:360px;
|
|
}
|
|
button {
|
|
font: 18px sans-serif;
|
|
padding: 8px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<video id="vid" autoplay="true"></video>
|
|
<br>
|
|
<button id="btn" onclick="start()">Start</button>
|
|
<script>
|
|
video = document.getElementById("vid");
|
|
function start() {
|
|
navigator.webkitGetUserMedia({video:true}, gotStream, function() {});
|
|
btn.disabled = true;
|
|
}
|
|
function gotStream(stream) {
|
|
video.src = webkitURL.createObjectURL(stream);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|