Player.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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="{{ escape(SubPath) }}{{ static_url("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. @media (max-width: 1200px) {
  46. body{
  47. background: #1d1d1d;
  48. }
  49. h1 {
  50. padding: 0.75rem;
  51. color: #bdbdbd;
  52. font-size: 1.1252rem;
  53. font-weight: normal;
  54. box-sizing: border-box;
  55. }
  56. }
  57. </style>
  58. </head>
  59. <body>
  60. <h1>{{ escape(PageTitle) }}</h1>
  61. <div class="wrapper">
  62. <video id=player width=960 height=540 class="video-js vjs-default-skin vjs-big-play-centered" controls>
  63. <source src="data:application/vnd.apple.mpegurl;base64,{{ escape(PageData) }}" type="application/x-mpegURL">
  64. </video>
  65. </div>
  66. <script src="{{ escape(SubPath) }}{{ static_url("js/video.min.js") }}"></script>
  67. <script src="{{ escape(SubPath) }}{{ static_url("js/videojs.hotkeys.min.js") }}"></script>
  68. <script>
  69. var player = videojs('player');
  70. videojs.Hls.xhr.beforeRequest = function(options) {
  71. if (options.headers) {
  72. delete options.headers.Range
  73. }
  74. return options;
  75. }
  76. player.ready(function () {
  77. this.hotkeys({
  78. seekStep: 5,
  79. volumeStep: 0.1,
  80. enableModifiersForNumbers: false
  81. });
  82. });
  83. player.on('play', function (e) {
  84. document.querySelector('h1').style.display = 'none';
  85. });
  86. </script>
  87. </body>
  88. </html>