53 lines
1.6 KiB
HTML
53 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>go2rtc - WebRTC</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
html, body {
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
|
|
#video {
|
|
/* video "container" size */
|
|
width: 100%;
|
|
height: 100%;
|
|
background: black;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<video id="video" autoplay controls playsinline muted></video>
|
|
<!--<video id="video" preload="auto" controls playsinline muted></video>-->
|
|
<script>
|
|
const baseUrl = location.origin + location.pathname.substr(
|
|
0, location.pathname.lastIndexOf("/")
|
|
);
|
|
const video = document.getElementById('video');
|
|
|
|
video.oncanplay = ev => console.log(ev.type, ev);
|
|
video.onplaying = ev => console.log(ev.type, ev);
|
|
video.onwaiting = ev => console.log(ev.type, ev);
|
|
video.onseeking = ev => console.log(ev.type, ev);
|
|
video.onloadeddata = ev => console.log(ev.type, ev);
|
|
video.oncanplaythrough = ev => console.log(ev.type, ev);
|
|
// video.ondurationchange = ev => console.log(ev.type, ev);
|
|
// video.ontimeupdate = ev => console.log(ev.type, ev);
|
|
video.onplay = ev => console.log(ev.type, ev);
|
|
video.onpause = ev => console.log(ev.type, ev);
|
|
video.onsuspended = ev => console.log(ev.type, ev);
|
|
video.onemptied = ev => console.log(ev.type, ev);
|
|
video.onstalled = ev => console.log(ev.type, ev);
|
|
|
|
console.log("start");
|
|
|
|
video.src = baseUrl + "/api/stream.mp4" + location.search;
|
|
</script>
|
|
</body>
|
|
</html> |