1 Star 0 Fork 8

Others-Code-Copy / webchat

forked from Aaron_ou / webchat 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webcantest.html 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Aaron_ou 提交于 2015-02-17 15:44 . first vision
<!DOCTYPE html>
<html>
<head>
<script src="static/js/jquery-1.11.2.js"></script>
<script src="static/js/bootstrap.min.js" ></script>
<script type="text/javascript">
$('document').ready(function () {
navigator.getUserMedia ||
(navigator.getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia);
if (navigator.getUserMedia) {
//do something
} else {
console.log('your browser not support getUserMedia');
}
$('#show').click(function () {
navigator.getUserMedia({
video: true,
audio: true
}, onSuccess, onError);
function onSuccess(stream) {
console.log(stream);
if (window.URL) {
$('#video').attr('src',window.URL.createObjectURL(stream));
} else {
$('#video').attr('src',stream);
}
}
function onError() {}
})
var myVideo=document.getElementById("video");
myVideo.play();
})
</script>
<meta charset="utf-8" />
<title>cantest</title>
</head>
<body>
<video id="video"></video>
<button class="btn default-btn" id="show">show</button>
</body>
</html>
Python
1
https://gitee.com/others-code-copy/webchat.git
git@gitee.com:others-code-copy/webchat.git
others-code-copy
webchat
webchat
master

搜索帮助