-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex3.html
179 lines (146 loc) · 4.64 KB
/
index3.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Video.js + hls.js</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"><!-- https://getbootstrap.com -->
<link href="https://vjs.zencdn.net/5.19.2/video-js.css" rel="stylesheet"><!-- https://videojs.com -->
<style type="text/css">
.video-js {
font-size: 1rem;
}
* {
box-sizing: border-box;
}
body {
font-family: 'Montserrat', sans-serif;
line-height: 1.6;
margin: 0;
min-height: 100vh;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
h2,
h3,
a {
color: #34495e;
}
a {
text-decoration: none;
}
.logo {
margin: 0;
font-size: 1.45em;
}
.main-nav {
margin-top: 5px;
}
.logo a,
.main-nav a {
padding: 10px 15px;
text-transform: uppercase;
text-align: center;
display: block;
}
.main-nav a {
color: #34495e;
font-size: .99em;
}
.main-nav a:hover {
color: #718daa;
}
.header {
padding-top: .5em;
padding-bottom: .5em;
border: 1px solid #a2a2a2;
background-color: #f4f4f4;
-webkit-box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
/* =================================
Media Queries
==================================== */
@media (min-width: 769px) {
.header,
.main-nav {
display: flex;
}
.header {
flex-direction: column;
align-items: center;
.header{
width: 80%;
margin: 0 auto;
max-width: 1150px;
}
}
}
@media (min-width: 1025px) {
.header {
flex-direction: row;
justify-content: space-between;
}
}
</style>
</head>
<body class="bg-light">
<header class="header">
<h1 class="logo"><a href="#">Flexbox</a></h1>
<ul class="main-nav">
<li><a href="./index.html">Quality selector</a></li>
<li><a href="./index2.html">Quality selector 2</a></li>
<li><a href="./index3.html">Load url</a></li>
<li><a href="./index4.html">Playlist</a></li>
<li><a href="./index5.html">Dynamic player</a></li>
<li><a href="./index6.html">Quality selector<sub>(No plugins)</sub></a></li>
</ul>
</header>
<div class="container">
<div class="my-5 embed-responsive embed-responsive-16by9">
<video id="video" class="embed-responsive-item video-js vjs-default-skin" width="640" height="360" autoplay controls></video>
</div>
<input type="text" placeholder="paste your link here" id="myInput">
<button id="change">change video</button>
<h2>HLS .m3u8 streams for testing</h2>
<ul>
<li>https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8</li>
<li>https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8</li>
<li>https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8</li>
<li>https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8 (Live)</li>
</ul>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://vjs.zencdn.net/5.19.2/video.js"></script><!-- https://videojs.com -->
<script src="js/hls.min.js?v=v0.9.1"></script><!-- https://github.com/video-dev/hls.js -->
<script src="js/videojs5-hlsjs-source-handler.min.js?v=0.3.1"></script><!-- https://github.com/streamroot/videojs-hlsjs-plugin -->
<script src="js/vjs-quality-picker.js?v=v0.0.2"></script><!-- https://github.com/streamroot/videojs-quality-picker -->
<script>
//http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
//https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8
(function ($) {
$(document).ready(function () {
// An example of playing with the Video.js javascript API
// Will start the video and then switch the source 3 seconds latter
// You can look at the doc there: http://docs.videojs.com/docs/guides/api.html
videojs('video').ready(function () {
var myPlayer = this;
myPlayer.qualityPickerPlugin();
myPlayer.src({type: 'application/x-mpegURL', src: 'https://content.jwplatform.com/manifests/yp34SRmf.m3u8'});
$("#change").on('click', function () {
var new_url = $("#myInput").val();
myPlayer.src({type: 'application/x-mpegURL', src: new_url});
});
});
});
})(jQuery);
</script>
</body>
</html>