index.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>videojs-contrib-hls Demo</title>
  6. <link href="/node_modules/video.js/dist/video-js.css" rel="stylesheet">
  7. <style>
  8. body {
  9. font-family: Arial, sans-serif;
  10. margin: 20px;
  11. }
  12. .info {
  13. background-color: #eee;
  14. border: thin solid #333;
  15. border-radius: 3px;
  16. padding: 0 5px;
  17. margin: 20px 0;
  18. }
  19. input {
  20. margin-top: 15px;
  21. min-width: 450px;
  22. padding: 5px;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <div class="info">
  28. <p>The video below is an <a href="https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/streamingmediaguide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008332-CH1-SW1">HTTP Live Stream</a>. On desktop browsers other than Safari, the HLS plugin will polyfill support for the format on top of the video.js Flash tech.</p>
  29. <p>Due to security restrictions in Flash, you will have to load this page over HTTP(S) to see the example in action.</p>
  30. </div>
  31. <video id="videojs-contrib-hls-player" class="video-js vjs-default-skin" controls>
  32. <source src="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">
  33. </video>
  34. <form id=load-url>
  35. <label>
  36. Video URL:
  37. <input id=url type=url value="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8">
  38. </label>
  39. <button type=submit>Load</button>
  40. </form>
  41. <ul>
  42. <li><a href="/test/">Run unit tests in browser.</a></li>
  43. <li><a href="/docs/api/">Read generated docs.</a></li>
  44. <li><a href="/examples">Browse Examples</a></li>
  45. </ul>
  46. <script src="/node_modules/video.js/dist/video.js"></script>
  47. <script src="/dist/videojs-contrib-hls.js"></script>
  48. <script>
  49. (function(window, videojs) {
  50. var player = window.player = videojs('videojs-contrib-hls-player');
  51. // hook up the video switcher
  52. var loadUrl = document.getElementById('load-url');
  53. var url = document.getElementById('url');
  54. loadUrl.addEventListener('submit', function(event) {
  55. event.preventDefault();
  56. player.src({
  57. src: url.value,
  58. type: 'application/x-mpegURL'
  59. });
  60. return false;
  61. });
  62. }(window, window.videojs));
  63. </script>
  64. </body>
  65. </html>