Ver código fonte

移动端视频

hanchaobo 2 anos atrás
pai
commit
fc3bebb4b4
3 arquivos alterados com 103 adições e 27 exclusões
  1. 1
    1
      src/views/components/footerPhone.vue
  2. 100
    24
      src/views/room.vue
  3. 2
    2
      src/views/test.vue

+ 1
- 1
src/views/components/footerPhone.vue Ver arquivo

73
     async mounted() {
73
     async mounted() {
74
         this.roomId = this.$route.query.roomId;
74
         this.roomId = this.$route.query.roomId;
75
         let roleFlag = this.$route.query.flag;
75
         let roleFlag = this.$route.query.flag;
76
-        this.roleFlag = roleFlag;
76
+        this.roleFlag = roleFlag || false;
77
         if (roleFlag) {
77
         if (roleFlag) {
78
             await this.startVideoFn();
78
             await this.startVideoFn();
79
         }
79
         }

+ 100
- 24
src/views/room.vue Ver arquivo

1
 <template>
1
 <template>
2
   <div class="page">
2
   <div class="page">
3
-    <div class="iconImg">
4
-      <i class="el-icon-d-arrow-left"></i>
3
+    <div class="iconImg" v-if="!modileFlag && rightType" @click="checkList(1)">
4
+      <i class="el-icon-d-arrow-left" style="font-size: 30px;color: aqua;"></i>
5
       <!-- <i class="el-icon-d-arrow-right"></i> -->
5
       <!-- <i class="el-icon-d-arrow-right"></i> -->
6
     </div>
6
     </div>
7
     <div class="roompage" @mouseover="mouseHover" v-if="modileFlag">
7
     <div class="roompage" @mouseover="mouseHover" v-if="modileFlag">
27
           :videoFlag="videoFlag" :sharFlag="sharFlag"></roomFooter>
27
           :videoFlag="videoFlag" :sharFlag="sharFlag"></roomFooter>
28
       </div>
28
       </div>
29
     </div>
29
     </div>
30
-    <div class="roomPhone" v-if="!modileFlag">
31
-      <div class="bodyPhone">
32
-        <div :class="userClassPhone" id="localStream">
33
-          <div class="userNamePhone">{{ userId }}</div>
30
+    <div class="roomPhone">
31
+      <div class="videoPage">
32
+        <div :class="sharingType">
34
         </div>
33
         </div>
35
-        <div :class="userClassPhone" v-for="(item, index) in userList" :key="index" :id="item">
36
-          <div class="userNamePhone">{{ item }}</div>
34
+        <div :class="bodyPhoneType">
35
+          <div :class="userClassPhone" id="localStream">
36
+            <div class="userNamePhone">{{ userId }}</div>
37
+          </div>
38
+          <div :class="userClassPhone" v-for="(item, index) in userList" :key="index" :id="item">
39
+            <div class="userNamePhone">{{ item }}</div>
40
+          </div>
41
+          <i class="el-icon-d-arrow-right" style="font-size: 30px;color: aqua;" @click="checkList(2)" v-if="!rightType"></i>
42
+        </div>
43
+        <div class="footerPhone">
44
+          <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
37
         </div>
45
         </div>
38
-      </div>
39
-      <div class="footerPhone">
40
-        <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
41
       </div>
46
       </div>
42
       <!-- <div class="header">
47
       <!-- <div class="header">
43
         <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
48
         <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
162
   },
167
   },
163
   data() {
168
   data() {
164
     return {
169
     return {
170
+      rightType:true,
171
+      sharingType: "sharing",
172
+      bodyPhoneType: "bodyPhone",
165
       videoList: "videoList",
173
       videoList: "videoList",
166
       videoClass: "videoItem",
174
       videoClass: "videoItem",
167
       resFlag: null,
175
       resFlag: null,
168
       appFlag: null,
176
       appFlag: null,
169
       userClassPhone: "userVideoPhone",
177
       userClassPhone: "userVideoPhone",
170
-      userList: [1,2,3,4,5],
178
+      userList: [1, 2],
171
       userHeight: "100%",
179
       userHeight: "100%",
172
       userPhoneHeight: "92%",
180
       userPhoneHeight: "92%",
173
       userSign: "",
181
       userSign: "",
236
     UploadUrl() {
244
     UploadUrl() {
237
       return window.location.origin + "/tjformal/video/upload";
245
       return window.location.origin + "/tjformal/video/upload";
238
     },
246
     },
247
+    /**移动端点击换出/隐藏视频列表 */
248
+    checkList(data) {
249
+      if (data == 1) {
250
+        if (this.userList.length < 1) {
251
+          this.userClassPhone = "userVideoPhone2"
252
+        }
253
+        this.sharingType = "sharing1";
254
+        this.bodyPhoneType = "bodyPhone1";
255
+        this.rightType = false;
256
+      } else if (data == 2) {
257
+        console.log("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUu");
258
+        this.sharingType = "sharing1";
259
+        this.bodyPhoneType = "bodyPhone2";
260
+        this.rightType = true;
261
+      }
262
+    },
239
     /**点击开启麦克风图标,关闭麦克风 */
263
     /**点击开启麦克风图标,关闭麦克风 */
240
     micClickOn() {
264
     micClickOn() {
241
       trtc.updateLocalAudio({ mute: true }).then(() => {
265
       trtc.updateLocalAudio({ mute: true }).then(() => {
740
 </script>
764
 </script>
741
 
765
 
742
 <style scoped>
766
 <style scoped>
743
-.iconImg{
767
+.iconImg {
744
   position: fixed;
768
   position: fixed;
745
-  top: 50%;
769
+  z-index: 9999;
770
+  top: 40%;
746
   height: 40px;
771
   height: 40px;
747
   width: 40px;
772
   width: 40px;
748
-  /* right: 10px; */
773
+  right: 0px;
749
 }
774
 }
775
+
750
 .roompage {
776
 .roompage {
751
   width: 100%;
777
   width: 100%;
752
   height: 100vh;
778
   height: 100vh;
884
 .roomPhone {
910
 .roomPhone {
885
   width: 100%;
911
   width: 100%;
886
   height: 100vh;
912
   height: 100vh;
887
-  background-color: yellow;
888
 }
913
 }
889
-.footerPhone{
914
+
915
+.footerPhone {
890
   width: 100%;
916
   width: 100%;
891
   height: 8%;
917
   height: 8%;
892
   background-color: greenyellow;
918
   background-color: greenyellow;
893
 }
919
 }
894
-.bodyPhone{
920
+
921
+.bodyPhone {
895
   width: 100%;
922
   width: 100%;
896
   height: 92%;
923
   height: 92%;
897
   display: flex;
924
   display: flex;
899
   flex-wrap: wrap;
926
   flex-wrap: wrap;
900
   align-items: center;
927
   align-items: center;
901
   overflow-y: scroll;
928
   overflow-y: scroll;
902
-  background-color: rebeccapurple;
929
+}
930
+
931
+.bodyPhone1 {
932
+  width: 40%;
933
+  height: 92%;
934
+  position: absolute;
935
+  right: 0;
936
+  top: 0;
937
+  display: flex;
938
+  justify-content: space-around;
939
+  flex-wrap: wrap;
940
+  align-items: center;
941
+  overflow-y: scroll;
942
+}
943
+.bodyPhone2{
944
+  width: 0;
945
+  height: 0;
946
+  position: absolute;
947
+  right: 0;
948
+  top: 0;
949
+  display: flex;
950
+  justify-content: space-around;
951
+  flex-wrap: wrap;
952
+  align-items: center;
953
+  overflow-y: scroll;
903
 }
954
 }
904
 /* 移动端样式 */
955
 /* 移动端样式 */
905
 
956
 
914
 .userVideoPhone {
965
 .userVideoPhone {
915
   width: 100%;
966
   width: 100%;
916
   height: 100%;
967
   height: 100%;
917
-  background-color: yellow;
968
+  background-color: rgb(124, 124, 104);
918
   position: relative;
969
   position: relative;
919
 }
970
 }
920
-.userVideoPhone1{
971
+
972
+.userVideoPhone1 {
921
   width: 100%;
973
   width: 100%;
922
   height: 49%;
974
   height: 49%;
923
-  background-color: rgb(43, 0, 255);
975
+  background-color: rgb(161, 160, 169);
924
   position: relative;
976
   position: relative;
925
 }
977
 }
926
-.userVideoPhone2{
978
+
979
+.userVideoPhone2 {
927
   width: 150px;
980
   width: 150px;
928
   height: 150px;
981
   height: 150px;
929
-  background-color: rgb(43, 0, 255);
982
+  background-color: rgb(161, 160, 169);
930
   position: relative;
983
   position: relative;
931
 }
984
 }
932
 
985
 
958
   margin-bottom: 10px;
1011
   margin-bottom: 10px;
959
   color: #38393b;
1012
   color: #38393b;
960
 }
1013
 }
1014
+
1015
+.videoPage {
1016
+  width: 100%;
1017
+  height: 100vh;
1018
+}
1019
+
1020
+.sharing1 {
1021
+  width: 100%;
1022
+  height: 92%;
1023
+  background: yellow;
1024
+}
1025
+
1026
+.sharing {
1027
+  width: 0;
1028
+  height: 0;
1029
+}
1030
+
1031
+.el-icon-d-arrow-right {
1032
+  position: absolute;
1033
+  left: 0;
1034
+  top: 45%;
1035
+  z-index: 999;
1036
+}
961
 </style>
1037
 </style>

+ 2
- 2
src/views/test.vue Ver arquivo

1
 <template>
1
 <template>
2
   <div class="page">
2
   <div class="page">
3
     <div class="content">
3
     <div class="content">
4
-      <div class="screenShare" v-if="screenShareFlag"></div>
4
+      <div class="screenShare"></div>
5
       <div :class="videoList">
5
       <div :class="videoList">
6
         <div :class="videoClass" v-for="(item, index) in vivdeoList"></div>
6
         <div :class="videoClass" v-for="(item, index) in vivdeoList"></div>
7
       </div>
7
       </div>
27
   methods: {
27
   methods: {
28
     screenShare() {
28
     screenShare() {
29
       this.videoList = "videoList1";
29
       this.videoList = "videoList1";
30
-      this.screenShareFlag = true;
30
+      // this.screenShareFlag = true;
31
       this.videoClass = "videoItem2";
31
       this.videoClass = "videoItem2";
32
     },
32
     },
33
     screenShareQ(){
33
     screenShareQ(){