-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathplayer.html
34 lines (30 loc) · 1.34 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Player</title>
<link href="https://unpkg.com/[email protected]/dist/video-js.css" rel="stylesheet" />
<link href="https://unpkg.com/[email protected]/dist/videojs-hls-quality-selector.css" rel="stylesheet" />
</head>
<body>
<h1>Player</h1>
<div>
<input type="text" id="video_src">
<button id="video_button">Play</button>
</div>
<video-js id="my_player" class="vjs-default-skin" controls preload="auto" width="640" height="268"></video-js>
<!--This is for Video.js by itself -->
<script src="https://unpkg.com/[email protected]/dist/video.js"></script>
<script src="https://unpkg.com/[email protected]/dist/videojs-contrib-quality-levels.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/videojs-hls-quality-selector.min.js"></script>
<!--This is for HLS compatibility with all major browsers-->
<script src="https://unpkg.com/@videojs/[email protected]/dist/videojs-http-streaming.min.js"></script>
<script>
var player = videojs('my_player');
document.getElementById("video_button").onclick = function() {
player.src(document.getElementById("video_src").value)
}
player.hlsQualitySelector();
</script>
</body>
</html>