Your Name 2 年前
父节点
当前提交
3285bb1e07
共有 2 个文件被更改,包括 33 次插入8 次删除
  1. 14
    2
      index.html
  2. 19
    6
      src/pages/pg1/video.vue

+ 14
- 2
index.html 查看文件

4
     <meta charset="UTF-8" />
4
     <meta charset="UTF-8" />
5
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
5
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
     <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover" />
6
     <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover" />
7
+    <meta name="screen-orientation" content="portrait">
7
     <!-- <script src="./wx/jweixin-1.6.0.js"></script> -->
8
     <!-- <script src="./wx/jweixin-1.6.0.js"></script> -->
8
     <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
9
     <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
9
     <script src="./jquery.1.9.1.js"></script>
10
     <script src="./jquery.1.9.1.js"></script>
33
 
34
 
34
       #vid-cover .goback {
35
       #vid-cover .goback {
35
         position: fixed;
36
         position: fixed;
36
-        right: 10px;
37
         top: 10px;
37
         top: 10px;
38
         width: 50px;
38
         width: 50px;
39
         height: 50px;
39
         height: 50px;
40
+      }
40
 
41
 
41
-        transform: rotate(90deg);
42
+      /* 横屏 */
43
+      @media all and (orientation : landscape) {
44
+        #vid-cover .goback {
45
+          left: 10px;
46
+        }
47
+      }
48
+      /* 竖屏 */
49
+      @media all and (orientation : portrait) {
50
+        #vid-cover .goback {
51
+          right: 10px;
52
+          transform: rotate(90deg);
53
+        }
42
       }
54
       }
43
     </style>
55
     </style>
44
   </head>
56
   </head>

+ 19
- 6
src/pages/pg1/video.vue 查看文件

77
 </script>
77
 </script>
78
 
78
 
79
 <style lang="less" scoped>
79
 <style lang="less" scoped>
80
+
81
+/* 横屏 */
82
+@media all and (orientation : landscape) {
83
+  .video-pg {
84
+    width: 100vw;
85
+    height: 100vh;
86
+  }
87
+}
88
+
89
+/* 竖屏 */
90
+@media all and (orientation : portrait) {
91
+  .video-pg {
92
+    width: 100vh;
93
+    height: 100vw;
94
+    transform-origin: center left;
95
+    transform: rotate(90deg) translate3d(-50vw, -50vw, 0);
96
+  }
97
+}
98
+
80
 .video-pg {
99
 .video-pg {
81
   position: relative;
100
   position: relative;
82
   background-color: #000;
101
   background-color: #000;
83
   overflow: hidden;
102
   overflow: hidden;
84
-  width: 100vh;
85
-  height: 100vw;
86
   display: flex;
103
   display: flex;
87
   align-items: center;
104
   align-items: center;
88
   justify-content: center;
105
   justify-content: center;
89
 
106
 
90
-  transform-origin: center left;
91
-  transform: rotate(90deg) translate3d(-50vw, -50vw, 0);
92
-
93
   .goback {
107
   .goback {
94
     position: fixed;
108
     position: fixed;
95
     z-index: 20001;
109
     z-index: 20001;
100
   video {
114
   video {
101
     flex: none;
115
     flex: none;
102
     width: 90%;
116
     width: 90%;
103
-    z-index: 90%;
104
   }
117
   }
105
 }
118
 }
106
 </style>
119
 </style>