UNPKG

9.83 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 </ul>
53
54 <div class="tab-content container-fluid">
55
56 <div class="tab-pane active" id="sources" role="tabpanel">
57 <div class="input-group mb-2">
58 <span class="input-group-text"><label for=load-source>Preloaded Sources</label></span>
59 <select id=load-source class="form-select">
60 <optgroup label="hls">
61 </optgroup>
62 <optgroup label="dash">
63 </optgroup>
64 <optgroup label="drm">
65 </optgroup>
66 <optgroup label="live">
67 </optgroup>
68 <optgroup label="low latency live">
69 </optgroup>
70 <optgroup label="json manifest object">
71 </optgroup>
72 </select>
73 </div>
74
75 <label for=url class="form-label">Source URL</label>
76 <div class="input-group">
77 <span class="input-group-text"><label for=url>Url</label></span>
78 <input id=url type=url class="form-control">
79 </div>
80
81 <label for=type class="form-label">Source Type (uses url extension if blank, usually application/x-mpegURL or application/dash+xml)</label>
82 <div class="input-group">
83 <span class="input-group-text"><label for=type>Type</label></span>
84 <input id=type type=text class="form-control">
85 </div>
86
87 <label for="keysystems" class="form-label">Optional Keystems JSON:</label>
88 <div class="input-group">
89 <span class="input-group-text"><label for=keysystems>keySystems JSON</label></span>
90 <textarea id=keysystems cols=100 rows=5 class="form-control"></textarea>
91 </div>
92
93 <button id=load-url type=button class="btn btn-primary my-2">Load</button>
94
95 </div>
96
97 <div class="tab-pane" id="options" role="tabpanel">
98 <div class="options">
99 <div class="form-check">
100 <input id=minified type="checkbox" class="form-check-input">
101 <label class="form-check-label" for="minified">Minified VHS (reloads player)</label>
102 </div>
103
104 <div class="form-check">
105 <input id=sync-workers type="checkbox" class="form-check-input">
106 <label class="form-check-label" for="sync-workers">Synchronous Web Workers (reloads player)</label>
107 </div>
108
109 <div class="form-check">
110 <input id=liveui type="checkbox" class="form-check-input" checked>
111 <label class="form-check-label" for="liveui">Enable the live UI (reloads player)</label>
112 </div>
113
114 <div class="form-check">
115 <input id=fluid type="checkbox" class="form-check-input">
116 <label class="form-check-label" for="fluid">Fluid mode</label>
117 </div>
118
119 <div class="form-check">
120 <input id=debug type="checkbox" class="form-check-input">
121 <label class="form-check-label" for="debug">Debug Logging</label>
122 </div>
123
124 <div class="form-check">
125 <input id=muted type="checkbox" class="form-check-input">
126 <label class="form-check-label" for="muted">Muted</label>
127 </div>
128
129 <div class="form-check">
130 <input id=autoplay type="checkbox" class="form-check-input">
131 <label class="form-check-label" for="autoplay">Autoplay</label>
132 </div>
133
134 <div class="form-check">
135 <input id=network-info type="checkbox" class="form-check-input">
136 <label class="form-check-label" for="network-info">Use networkInfo API for bandwidth estimations (reloads player)</label>
137 </div>
138
139 <div class="form-check">
140 <input id=dts-offset type="checkbox" class="form-check-input">
141 <label class="form-check-label" for="dts-offset">Use DTS instead of PTS for Timestamp Offset calculation (reloads player)</label>
142 </div>
143
144 <div class="form-check">
145 <input id=llhls type="checkbox" class="form-check-input">
146 <label class="form-check-label" for="llhls">[EXPERIMENTAL] Enables support for ll-hls (reloads player)</label>
147 </div>
148
149 <div class="form-check">
150 <input id=buffer-water type="checkbox" class="form-check-input">
151 <label class="form-check-label" for="buffer-water">[EXPERIMENTAL] Use Buffer Level for ABR (reloads player)</label>
152 </div>
153
154 <div class="form-check">
155 <input id=exact-manifest-timings type="checkbox" class="form-check-input">
156 <label class="form-check-label" for="exact-manifest-timings">[EXPERIMENTAL] Use exact manifest timings for segment choices (reloads player)</label>
157 </div>
158
159 <div class="form-check">
160 <input id=pixel-diff-selector type="checkbox" class="form-check-input">
161 <label class="form-check-label" for="pixel-diff-selector">[EXPERIMENTAL] Use the Pixel difference resolution selector (reloads player)</label>
162 </div>
163
164 <div class="form-check">
165 <input id=override-native type="checkbox" class="form-check-input" checked>
166 <label class="form-check-label" for="override-native">Override Native (reloads player)</label>
167 </div>
168
169 <div class="form-check">
170 <input id=mirror-source type="checkbox" class="form-check-input" checked>
171 <label class="form-check-label" for="mirror-source">Mirror sources from player.src (reloads player, uses EXPERIMENTAL sourceset option)</label>
172 </div>
173
174 <div class="input-group">
175 <span class="input-group-text"><label for=preload>Preload (reloads player)</label></span>
176 <select id=preload class="form-select">
177 <option selected>auto</option>
178 <option>none</option>
179 <option>metadata</option>
180 </select>
181 </div>
182 </div>
183 </div>
184
185 <div class="tab-pane" id="levels" role="tabpanel">
186 <div class="input-group">
187 <span class="input-group-text"><label for=representations>Representations</label></span>
188 <select id='representations' class="form-select"></select>
189 </div>
190 </div>
191
192 <div class="tab-pane" id="player-stats" role="tabpanel">
193 <div class="row">
194 <div class="player-stats col-4">
195 <dl>
196 <dt>Current Time:</dt>
197 <dd class="current-time-stat">0</dd>
198 <dt>Buffered:</dt>
199 <dd class="buffered-stat">-</dd>
200 <dt>Video Buffered:</dt>
201 <dd class="video-buffered-stat">-</dd>
202 <dt>Audio Buffered:</dt>
203 <dd class="audio-buffered-stat">-</dd>
204 <dt>Seekable:</dt>
205 <dd><span class="seekable-start-stat">-</span> - <span class="seekable-end-stat">-</span></dd>
206 <dt>Video Bitrate:</dt>
207 <dd class="video-bitrate-stat">0 kbps</dd>
208 <dt>Measured Bitrate:</dt>
209 <dd class="measured-bitrate-stat">0 kbps</dd>
210 <dt>Video Timestamp Offset</dt>
211 <dd class="video-timestampoffset">0</dd>
212 <dt>Audio Timestamp Offset</dt>
213 <dd class="audio-timestampoffset">0</dd>
214 </dl>
215 </div>
216 <ul id="segment-metadata" class="col-8"></ul>
217 </div>
218 </div>
219 </div>
220
221 <footer class="text-center p-3" id=unit-test-link>
222 <a href="test/debug.html">Run unit tests</a>
223 </footer>
224
225 <script>
226 var unitTestLink = document.getElementById('unit-test-link');
227
228 // removal test run link on netlify, as we cannot run tests there.
229 if ((/netlify.app/).test(window.location.host)) {
230 unitTestLink.remove();
231 }
232 </script>
233 <script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
234 <script src="scripts/index.js"></script>
235 <script>
236 window.startDemo(function(player) {
237 // do something with setup player
238 });
239 </script>
240 </body>
241</html>