Player.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>{{ escape(PageTitle) }}</title>
  6. <meta name="referrer" content="no-referrer">
  7. <link rel="stylesheet" type="text/css" href="static/css/video-js.min.css">
  8. <style type="text/css">
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. html, body {
  14. height: 100%;
  15. overflow: hidden;
  16. }
  17. body {
  18. text-align: center;
  19. background: black;
  20. }
  21. h1 {
  22. padding: 30px;
  23. color: #bdbdbd;
  24. font-size: 45px;
  25. font-weight: normal;
  26. box-sizing: border-box;
  27. }
  28. video:focus {
  29. outline: none;
  30. }
  31. .wrapper {
  32. width: 100%;
  33. margin: auto;
  34. height: 100%;
  35. text-align: center;
  36. }
  37. .video-js {
  38. width: 100% !important;
  39. height: 100% !important;
  40. position: relative !important;
  41. }
  42. .vjs-big-play-button {
  43. margin-top: -130px !important;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <h1>{{ escape(PageTitle) }}</h1>
  49. <div class="wrapper">
  50. <video id=player width=960 height=540 class="video-js vjs-default-skin vjs-big-play-centered" controls>
  51. <source src="data:application/vnd.apple.mpegurl;base64,{{ escape(PageData) }}" type="application/x-mpegURL">
  52. </video>
  53. </div>
  54. <script src="static/js/video.min.js"></script>
  55. <script src="static/js/videojs.hotkeys.min.js"></script>
  56. <script>
  57. var player = videojs('player');
  58. videojs.Hls.xhr.beforeRequest = function(options) {
  59. if (options.headers) {
  60. delete options.headers.Range
  61. }
  62. return options;
  63. }
  64. player.ready(function () {
  65. this.hotkeys({
  66. seekStep: 5,
  67. volumeStep: 0.1,
  68. enableModifiersForNumbers: false
  69. });
  70. });
  71. </script>
  72. </body>
  73. </html>