index.html 11 KB

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