Commit 765ea86b88a9f57866f9b5fc1d9e92b1d0649e55

Authored by fengtao
1 parent 1a73a63a

fix:修复mp端视频管理点击默认不全屏显示问题(兼容APP端)

Showing 1 changed file with 6 additions and 7 deletions
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
25 class="video" 25 class="video"
26 :src="item.videoUrl" 26 :src="item.videoUrl"
27 controls 27 controls
  28 + :title="item.name"
28 webkit-playsinline 29 webkit-playsinline
29 x5-video-player-type="h5" 30 x5-video-player-type="h5"
30 x5-video-orientation="portraint" 31 x5-video-orientation="portraint"
@@ -64,8 +65,7 @@ export default { @@ -64,8 +65,7 @@ export default {
64 current: 0, 65 current: 0,
65 cameraTotal: 0, 66 cameraTotal: 0,
66 list: [], 67 list: [],
67 - ordId: '',  
68 - videoContext: null 68 + ordId: ''
69 }; 69 };
70 }, 70 },
71 onShow() { 71 onShow() {
@@ -74,9 +74,6 @@ export default { @@ -74,9 +74,6 @@ export default {
74 this.loadData(1, this.ordId); 74 this.loadData(1, this.ordId);
75 } 75 }
76 }, 76 },
77 - onReady() {  
78 - this.videoContext = uni.createVideoContext('myVideo', this);  
79 - },  
80 onHide() { 77 onHide() {
81 this.ordId = ''; 78 this.ordId = '';
82 this.loadData(1, null); 79 this.loadData(1, null);
@@ -126,17 +123,19 @@ export default { @@ -126,17 +123,19 @@ export default {
126 }, 123 },
127 playVideo(e) { 124 playVideo(e) {
128 /** 125 /**
129 - * 播放当前视频,暂停其余视频 126 + * 点击全屏播放当前视频,暂停其余视频
  127 + * 兼容APP和MP端
130 */ 128 */
131 let currentId = 'video' + e.currentTarget.dataset.id; 129 let currentId = 'video' + e.currentTarget.dataset.id;
132 this.videoContent = uni.createVideoContext(currentId, this); 130 this.videoContent = uni.createVideoContext(currentId, this);
133 - this.videoContext.requestFullScreen({ direction: 90 }); 131 + this.videoContent.requestFullScreen();
134 // 获取视频列表 132 // 获取视频列表
135 let trailer = this.list; 133 let trailer = this.list;
136 trailer.forEach((item, index) => { 134 trailer.forEach((item, index) => {
137 if (item.videoUrl != null && item.videoUrl != '') { 135 if (item.videoUrl != null && item.videoUrl != '') {
138 let temp = 'video' + item.id; 136 let temp = 'video' + item.id;
139 if (temp != currentId) { 137 if (temp != currentId) {
  138 + //暂停不是当前的视频
140 uni.createVideoContext(temp, this).pause(); 139 uni.createVideoContext(temp, this).pause();
141 } 140 }
142 } 141 }