-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplayer.html
38 lines (35 loc) · 1.1 KB
/
player.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
<style>
#container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#stream_preview {
width: 100%;
max-height: 100%;
}
</style>
</head>
<body>
<div id="container">
<video id="stream_preview" controls preload="auto" class="video-js">
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</div>
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
<script src="https://unpkg.com/flv.js/dist/flv.min.js"></script>
<script src="https://unpkg.com/videojs-flvjs/dist/videojs-flvjs.min.js"></script>
<script>
const url = new URL(location.href);
var streamURL = url.searchParams.get("streamURL");
var myPlayer = videojs("stream_preview");
myPlayer.src({type: 'video/x-flv', src: streamURL});
</script>
</body>
</html>