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