You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>WebRTC webcam</title>
|
|
<style>
|
|
button {
|
|
padding: 8px 16px;
|
|
}
|
|
|
|
video {
|
|
width: 100%;
|
|
}
|
|
|
|
.option {
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
#media {
|
|
max-width: 1280px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="option">
|
|
<input id="use-stun" type="checkbox"/>
|
|
<label for="use-stun">Use STUN server</label>
|
|
</div>
|
|
<button id="start" onclick="start()">Start</button>
|
|
<button id="stop" style="display: none" onclick="stop()">Stop</button>
|
|
|
|
<div id="media">
|
|
<h2>Media</h2>
|
|
|
|
<audio id="audio" autoplay="true"></audio>
|
|
<video id="video" autoplay="true" playsinline="true"></video>
|
|
</div>
|
|
<script src="/resources/scripts/client.js"></script>
|
|
<script>
|
|
window.onload = function() {
|
|
// 页面加载完成后执行的代码
|
|
start();
|
|
var intervalId = setInterval(showView, 1000);
|
|
setTimeout(function() {
|
|
clearInterval(intervalId); // 停止定时循环
|
|
console.log("Interval stopped after 10 seconds");
|
|
}, 10000);
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|