You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.7 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>video.js HLS Plugin Example</title>
  6. <link href="node_modules/video.js/dist/video-js.css" rel="stylesheet">
  7. <!-- video.js -->
  8. <script src="node_modules/video.js/dist/video.js"></script>
  9. <!-- Media Sources plugin -->
  10. <script src="node_modules/videojs-contrib-media-sources/dist/videojs-media-sources.js"></script>
  11. <!-- HLS plugin -->
  12. <script src="src/videojs-hls.js"></script>
  13. <!-- m3u8 handling -->
  14. <script src="src/xhr.js"></script>
  15. <script src="src/stream.js"></script>
  16. <script src="src/m3u8/m3u8-parser.js"></script>
  17. <script src="src/playlist.js"></script>
  18. <script src="src/playlist-loader.js"></script>
  19. <script src="node_modules/pkcs7/dist/pkcs7.unpad.js"></script>
  20. <script src="src/decrypter.js"></script>
  21. <script src="src/bin-utils.js"></script>
  22. <style>
  23. body {
  24. font-family: Arial, sans-serif;
  25. margin: 20px;
  26. }
  27. .info {
  28. background-color: #eee;
  29. border: thin solid #333;
  30. border-radius: 3px;
  31. padding: 0 5px;
  32. margin: 20px 0;
  33. }
  34. input {
  35. margin-top: 15px;
  36. min-width: 450px;
  37. padding: 5px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div class="info">
  43. <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>
  44. <p>Due to security restrictions in Flash, you will have to load this page over HTTP(S) to see the example in action.</p>
  45. </div>
  46. <video id="video"
  47. class="video-js vjs-default-skin"
  48. height="300"
  49. width="600"
  50. controls>
  51. <source
  52. src="http://solutions.brightcove.com/jwhisenant/hls/apple/bipbop/bipbopall.m3u8"
  53. type="application/x-mpegURL">
  54. </video>
  55. <form id=load-url>
  56. <label>
  57. Video URL:
  58. <input id=url type=url value="http://solutions.brightcove.com/jwhisenant/hls/apple/bipbop/bipbopall.m3u8">
  59. </label>
  60. <button type=submit>Load</button>
  61. </form>
  62. <script>
  63. videojs.options.flash.swf = 'node_modules/videojs-swf/dist/video-js.swf';
  64. // initialize the player
  65. var player = videojs('video');
  66. // hook up the video switcher
  67. var loadUrl = document.getElementById('load-url');
  68. var url = document.getElementById('url');
  69. loadUrl.addEventListener('submit', function(event) {
  70. event.preventDefault();
  71. player.src({
  72. src: url.value,
  73. type: 'application/x-mpegURL'
  74. });
  75. return false;
  76. });
  77. </script>
  78. </body>
  79. </html>