video.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta content="yes" name="apple-mobile-web-app-capable" />
  8. <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  9. <title>沙盘播放</title>
  10. </head>
  11. <link rel="stylesheet" href="./TemplateData/style.css">
  12. <style>
  13. #initVideo{
  14. position: fixed;
  15. width: 100%;
  16. transform: translate(-50%,-50%);
  17. left: 50%;
  18. top: 50%;
  19. display: inline-block;
  20. }
  21. .tips{
  22. display: none;
  23. position: fixed;
  24. top: 0;
  25. left: 0;
  26. width: 100%;
  27. height: 100%;
  28. z-index: 111111;
  29. background: rgba(0, 0, 0, 0.5);
  30. }
  31. .tips > span{
  32. position: absolute;
  33. top: 50%;
  34. left: 50%;
  35. display: inline-block;
  36. transform: translate(-50%,-50%);
  37. background: #fff;
  38. border-radius: 20px;
  39. padding: 14px 26px;
  40. }
  41. /*横屏*/
  42. @media (orientation:landscape) {
  43. body{
  44. background-color: #000;
  45. }
  46. #initVideo{
  47. width: auto;
  48. height: 100%;
  49. }
  50. .tips{
  51. display: block;
  52. animation:showMask 10s forwards;
  53. }
  54. }
  55. /*竖屏*/
  56. @media (orientation:portrait){ }
  57. @keyframes showMask
  58. {
  59. 0% {
  60. opacity: 1;
  61. }
  62. 80%{
  63. opacity: 1;
  64. }
  65. 100% {
  66. display: none;
  67. opacity: 0;
  68. pointer-events: none;
  69. }
  70. }
  71. </style>
  72. <body>
  73. <video id="initVideo" src="./mobile.mp4" x5-video-player-type="h5" x5-video-player-fullscreen="true" webkit-playsinline="" playsinline="" x5-playsinline="" crossorigin="anonymous"> </video>
  74. <div class="welcome">
  75. <span id="enter">进入沙盘</span>
  76. </div>
  77. <div class="tips">
  78. <span>竖屏效果展示更佳</span>
  79. </div>
  80. <script>
  81. window.initVideo = document.getElementById("initVideo");
  82. document.addEventListener(
  83. 'WeixinJSBridgeReady',
  84. function() {
  85. window.initVideo.play();
  86. },
  87. false
  88. );
  89. // window.initVideo.play();
  90. let elem = document.querySelector('#enter')
  91. elem.addEventListener('click',function () {
  92. let ele = document.querySelector('.welcome')
  93. ele.style.display = 'none'
  94. window.initVideo.play();
  95. })
  96. </script>
  97. </body>
  98. </html>
  99. <script>
  100. </script>