forked from kmoskwiak/videojs-resolution-switcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyoutube.html
64 lines (59 loc) · 1.52 KB
/
youtube.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Video.js Resolution Switcher</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="../lib/videojs-resolution-switcher.css" rel="stylesheet">
<style>
body {
font-family: Arial, sans-serif;
background: #777;
}
.info {
background-color: #eee;
border: thin solid #333;
border-radius: 3px;
padding: 0 5px;
text-align: center;
}
.video-js {
margin: 40px auto;
}
</style>
</head>
<body>
<div class="info">
<p>
Youtube tech
</p>
</div>
<video id='video' class="video-js vjs-default-skin"></video>
<script src="../node_modules/video.js/dist/video.js"></script>
<script src="../node_modules/videojs-youtube/dist/Youtube.js"></script>
<script src="../lib/videojs-resolution-switcher.js"></script>
<script>
// fire up the plugin
videojs('video', {
controls: true,
muted: true,
techOrder: ["youtube"],
width: 500,
sources: [{ "type": "video/youtube", "src": "https://www.youtube.com/watch?v=iD_MyDbP_ZE"}],
plugins: {
videoJsResolutionSwitcher: {
default: 'low',
dynamicLabel: true
}
}
}, function(){
var player = this;
window.player = player;
player.on('resolutionchange', function(){
console.info('Source changed')
})
});
</script>
</body>
</html>