UNPKG

10.8 kBHTMLView Raw
1<!DOCTYPE html>
2<html>
3<head>
4 <meta charset="utf-8">
5 <title>videojs-http-streaming Demo</title>
6 <link rel="icon" href="logo.svg">
7 <link href="node_modules/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
8 <link href="node_modules/video.js/dist/video-js.css" rel="stylesheet">
9 <link href="node_modules/videojs-http-source-selector/dist/videojs-http-source-selector.css" rel="stylesheet">
10 <style>
11 .form-check {
12 background-color: hsl(0, 0%, 90%);
13 margin-block: 0.5rem;
14 padding: 0.25em 0.25em 0.25em 1.75em;
15 width: 700px;
16 width: fit-content;
17 }
18 #player-fixture {
19 min-height: 250px;
20 }
21 #segment-metadata {
22 list-style: none;
23 }
24 #segment-metadata pre {
25 overflow: scroll;
26 }
27 </style>
28</head>
29<body class="m-4">
30 <header class="container-fluid">
31 <a href="https://github.com/videojs/http-streaming" class="d-flex align-items-center pb-3 mb-5 border-bottom" style="height: 4em">
32 <img src="./logo.svg" alt="VHS logo showcasing a VHS tape with the Video.js logo on the label" class="rounded mh-100">
33 <span class="fs-1 ps-2">VHS: videojs-http-streaming</span>
34 </a>
35 </header>
36
37 <div id="player-fixture" class="container-fluid pb-3 mb-3"></div>
38
39 <ul class="nav nav-tabs container-fluid mb-3" id="myTab" role="tablist">
40 <li class="nav-item" role="presentation">
41 <button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#sources" type="button" role="tab" aria-selected="true">Sources</button>
42 </li>
43 <li class="nav-item" role="presentation">
44 <button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#options" type="button" role="tab" aria-selected="false">Options</button>
45 </li>
46 <li class="nav-item" role="presentation">
47 <button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#levels" type="button" role="tab" aria-selected="false">Representations</button>
48 </li>
49 <li class="nav-item" role="presentation">
50 <button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#player-stats" type="button" role="tab" aria-selected="false">Player Stats</button>
51 </li>
52 <li class="nav-item" role="presentation">
53 <button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#content-steering" type="button" role="tab" aria-selected="false">Content Steering</button>
54 </li>
55 </ul>
56
57 <div class="tab-content container-fluid">
58
59 <div class="tab-pane active" id="sources" role="tabpanel">
60 <div class="input-group mb-2">
61 <span class="input-group-text"><label for=load-source>Preloaded Sources</label></span>
62 <select id=load-source class="form-select">
63 <optgroup label="hls">
64 </optgroup>
65 <optgroup label="dash">
66 </optgroup>
67 <optgroup label="drm">
68 </optgroup>
69 <optgroup label="live">
70 </optgroup>
71 <optgroup label="low latency live">
72 </optgroup>
73 <optgroup label="json manifest object">
74 </optgroup>
75 </select>
76 </div>
77
78 <label for=url class="form-label">Source URL</label>
79 <div class="input-group">
80 <span class="input-group-text"><label for=url>Url</label></span>
81 <input id=url type=url class="form-control">
82 </div>
83
84 <label for=type class="form-label">Source Type (uses url extension if blank, usually application/x-mpegURL or application/dash+xml)</label>
85 <div class="input-group">
86 <span class="input-group-text"><label for=type>Type</label></span>
87 <input id=type type=text class="form-control">
88 </div>
89
90 <label for="keysystems" class="form-label">Optional Keystems JSON:</label>
91 <div class="input-group">
92 <span class="input-group-text"><label for=keysystems>keySystems JSON</label></span>
93 <textarea id=keysystems cols=100 rows=5 class="form-control"></textarea>
94 </div>
95
96 <button id=load-url type=button class="btn btn-primary my-2">Load</button>
97
98 </div>
99
100 <div class="tab-pane" id="options" role="tabpanel">
101 <div class="options">
102 <div class="form-check">
103 <input id=minified type="checkbox" class="form-check-input">
104 <label class="form-check-label" for="minified">Minified VHS (reloads player)</label>
105 </div>
106
107 <div class="form-check">
108 <input id=sync-workers type="checkbox" class="form-check-input">
109 <label class="form-check-label" for="sync-workers">Synchronous Web Workers (reloads player)</label>
110 </div>
111
112 <div class="form-check">
113 <input id=liveui type="checkbox" class="form-check-input" checked>
114 <label class="form-check-label" for="liveui">Enable the live UI (reloads player)</label>
115 </div>
116
117 <div class="form-check">
118 <input id=fluid type="checkbox" class="form-check-input">
119 <label class="form-check-label" for="fluid">Fluid mode</label>
120 </div>
121
122 <div class="form-check">
123 <input id=debug type="checkbox" class="form-check-input">
124 <label class="form-check-label" for="debug">Debug Logging</label>
125 </div>
126
127 <div class="form-check">
128 <input id=muted type="checkbox" class="form-check-input">
129 <label class="form-check-label" for="muted">Muted</label>
130 </div>
131
132 <div class="form-check">
133 <input id=autoplay type="checkbox" class="form-check-input">
134 <label class="form-check-label" for="autoplay">Autoplay</label>
135 </div>
136
137 <div class="form-check">
138 <input id=network-info type="checkbox" class="form-check-input">
139 <label class="form-check-label" for="network-info">Use networkInfo API for bandwidth estimations (reloads player)</label>
140 </div>
141
142 <div class="form-check">
143 <input id=dts-offset type="checkbox" class="form-check-input">
144 <label class="form-check-label" for="dts-offset">Use DTS instead of PTS for Timestamp Offset calculation (reloads player)</label>
145 </div>
146
147 <div class="form-check">
148 <input id=llhls type="checkbox" class="form-check-input">
149 <label class="form-check-label" for="llhls">[EXPERIMENTAL] Enables support for ll-hls (reloads player)</label>
150 </div>
151
152 <div class="form-check">
153 <input id=buffer-water type="checkbox" class="form-check-input">
154 <label class="form-check-label" for="buffer-water">[EXPERIMENTAL] Use Buffer Level for ABR (reloads player)</label>
155 </div>
156
157 <div class="form-check">
158 <input id=exact-manifest-timings type="checkbox" class="form-check-input">
159 <label class="form-check-label" for="exact-manifest-timings">[EXPERIMENTAL] Use exact manifest timings for segment choices (reloads player)</label>
160 </div>
161
162 <div class="form-check">
163 <input id=pixel-diff-selector type="checkbox" class="form-check-input">
164 <label class="form-check-label" for="pixel-diff-selector">[EXPERIMENTAL] Use the Pixel difference resolution selector (reloads player)</label>
165 </div>
166
167 <div class="form-check">
168 <input id=override-native type="checkbox" class="form-check-input" checked>
169 <label class="form-check-label" for="override-native">Override Native (reloads player)</label>
170 </div>
171
172 <div class="form-check">
173 <input id=mirror-source type="checkbox" class="form-check-input" checked>
174 <label class="form-check-label" for="mirror-source">Mirror sources from player.src (reloads player, uses EXPERIMENTAL sourceset option)</label>
175 </div>
176
177 <div class="form-check">
178 <input id="forced-subtitles" type="checkbox" class="form-check-input">
179 <label class="form-check-label" for="forced-subtitles">Use Forced Subtitles (reloads player)</label>
180 </div>
181
182 <div class="input-group">
183 <span class="input-group-text"><label for=preload>Preload (reloads player)</label></span>
184 <select id=preload class="form-select">
185 <option selected>auto</option>
186 <option>none</option>
187 <option>metadata</option>
188 </select>
189 </div>
190 </div>
191 </div>
192
193 <div class="tab-pane" id="levels" role="tabpanel">
194 <div class="input-group">
195 <span class="input-group-text"><label for=representations>Representations</label></span>
196 <select id='representations' class="form-select"></select>
197 </div>
198 </div>
199
200 <div class="tab-pane" id="player-stats" role="tabpanel">
201 <div class="row">
202 <div class="player-stats col-4">
203 <dl>
204 <dt>Current Time:</dt>
205 <dd class="current-time-stat">0</dd>
206 <dt>Buffered:</dt>
207 <dd class="buffered-stat">-</dd>
208 <dt>Video Buffered:</dt>
209 <dd class="video-buffered-stat">-</dd>
210 <dt>Audio Buffered:</dt>
211 <dd class="audio-buffered-stat">-</dd>
212 <dt>Seekable:</dt>
213 <dd><span class="seekable-start-stat">-</span> - <span class="seekable-end-stat">-</span></dd>
214 <dt>Video Bitrate:</dt>
215 <dd class="video-bitrate-stat">0 kbps</dd>
216 <dt>Measured Bitrate:</dt>
217 <dd class="measured-bitrate-stat">0 kbps</dd>
218 <dt>Video Timestamp Offset</dt>
219 <dd class="video-timestampoffset">0</dd>
220 <dt>Audio Timestamp Offset</dt>
221 <dd class="audio-timestampoffset">0</dd>
222 </dl>
223 </div>
224 <ul id="segment-metadata" class="col-8"></ul>
225 </div>
226 </div>
227
228 <div class="tab-pane" id="content-steering" role="tabpanel">
229 <div class="row">
230 <div class="content-steering col-8">
231 <dl>
232 <dt>Current Pathway:</dt>
233 <dd class="current-pathway"></dd>
234 <dt>Available Pathways:</dt>
235 <dd class="available-pathways"></dd>
236 <dt>Steering Manifest:</dt>
237 <dd class="steering-manifest"></dd>
238 </dl>
239 </div>
240 </div>
241 </div>
242 </div>
243 </div>
244
245 <footer class="text-center p-3" id=unit-test-link>
246 <a href="test/debug.html">Run unit tests</a>
247 </footer>
248
249 <script>
250 var unitTestLink = document.getElementById('unit-test-link');
251
252 // removal test run link on netlify, as we cannot run tests there.
253 if ((/netlify.app/).test(window.location.host)) {
254 unitTestLink.remove();
255 }
256 </script>
257 <script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
258 <script src="scripts/index.js"></script>
259 <script>
260 window.startDemo(function(player) {
261 // do something with setup player
262 });
263 </script>
264 </body>
265</html>