Fix:3132 【商城小程序】店铺视频资讯内容无法显示,安卓(小米,vivo)
This commit is contained in:
@@ -225,16 +225,33 @@
|
||||
</view>
|
||||
<view class="info-item-body">
|
||||
<view v-if="item.type === 2" class="video">
|
||||
<video
|
||||
:src="item.video"
|
||||
<view @click="infoItemViewClick(item, index)" v-if="activeVideo !== 'video-item' + index" class="play-icon">
|
||||
<u-icon name="play-right-fill" color="#fff" size="48"></u-icon>
|
||||
</view>
|
||||
<image
|
||||
v-if="activeVideo !== 'video-item' + index"
|
||||
:src="item.video + '?vframe/jpg/offset/1'"
|
||||
:poster="item.video + '?vframe/jpg/offset/1'"
|
||||
controls
|
||||
play-btn-position="center"
|
||||
:show-fullscreen-btn="false"
|
||||
:id="'video-item' + index"
|
||||
class="video-item"
|
||||
@click="infoItemViewClick(item, index)"
|
||||
/>
|
||||
<video
|
||||
v-else
|
||||
:src="item.video"
|
||||
controls
|
||||
autoplay
|
||||
play-btn-position="center"
|
||||
:show-fullscreen-btn="false"
|
||||
class="video-item"
|
||||
:id="'video-item' + index"
|
||||
@play="infoItemViewClick(item, index)"
|
||||
/>
|
||||
>
|
||||
|
||||
</video>
|
||||
</view>
|
||||
<view v-else>
|
||||
<img-box
|
||||
@@ -367,7 +384,8 @@ export default {
|
||||
isLoadInfoListSuccess: false,
|
||||
picColumnWidth: '325rpx',
|
||||
infoArray: [],
|
||||
videoPlayers: []
|
||||
videoPlayers: [],
|
||||
activeVideo: 'coverVideo',
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
@@ -445,6 +463,7 @@ export default {
|
||||
})
|
||||
},
|
||||
coverPlay(){
|
||||
this.activeVideo = 'coverVideo'
|
||||
this.videoPlayers.forEach(player => {
|
||||
const playerCtx = uni.createVideoContext(player, this)
|
||||
playerCtx.pause()
|
||||
@@ -455,6 +474,7 @@ export default {
|
||||
const coverCtx = uni.createVideoContext('coverVideo', this)
|
||||
coverCtx.pause()
|
||||
const playerId = 'video-item' + index
|
||||
this.activeVideo = 'video-item' + index
|
||||
if(this.videoPlayers.includes(playerId)) {
|
||||
this.videoPlayers.forEach(player => {
|
||||
if(player === playerId) return
|
||||
@@ -616,6 +636,17 @@ export default {
|
||||
padding: 0 20rpx 20rpx 20rpx;
|
||||
.video {
|
||||
padding: 20rpx 0 0 0;
|
||||
position: relative;
|
||||
.play-icon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.video-item {
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
|
||||
Reference in New Issue
Block a user