Fix:3172 【商城小程序】视频评论还是无法播放

This commit is contained in:
modendeveloper
2025-01-26 20:02:02 +08:00
parent 0372209000
commit 0802e6349e
+34 -1
View File
@@ -21,10 +21,27 @@
<view class="evaluate-infor v12-font-24">{{ item.comment }}</view> <view class="evaluate-infor v12-font-24">{{ item.comment }}</view>
<view class="imgList acea-row"> <view class="imgList acea-row">
<view v-if="item.video" class="pictrue"> <view v-if="item.video" class="pictrue">
<view
@click="pauseOtherVideo('video' + evaluateWtapperIndex)"
v-if="activeVideo !== 'video' + evaluateWtapperIndex"
class="play-icon"
>
<u-icon name="play-right-fill" color="#fff" size="48"></u-icon>
</view>
<image
v-if="activeVideo !== 'video' + evaluateWtapperIndex"
:src="item.video + '?vframe/jpg/offset/1'"
class="image"
@click="pauseOtherVideo('video' + evaluateWtapperIndex)"
>
</image>
<video <video
v-else
:src="item.video" :src="item.video"
:poster="item.video + '?vframe/jpg/offset/1'" :poster="item.video + '?vframe/jpg/offset/1'"
controls controls
autoplay
play-btn-position="center" play-btn-position="center"
:id="'video' + evaluateWtapperIndex" :id="'video' + evaluateWtapperIndex"
class="image" class="image"
@@ -59,7 +76,8 @@ export default {
}, },
data: function() { data: function() {
return { return {
videoPlayers: [] videoPlayers: [],
activeVideo: null,
}; };
}, },
mounted: function() {}, mounted: function() {},
@@ -73,6 +91,7 @@ export default {
}, },
// 播放视频时暂停其他视频 // 播放视频时暂停其他视频
pauseOtherVideo(video) { pauseOtherVideo(video) {
this.activeVideo = video;
if(this.videoPlayers.includes(video)) { if(this.videoPlayers.includes(video)) {
this.videoPlayers.forEach((item) => { this.videoPlayers.forEach((item) => {
if(item !== video) { if(item !== video) {
@@ -96,4 +115,18 @@ export default {
.time{ .time{
padding: 0 !important; padding: 0 !important;
} }
.evaluateWtapper .evaluateItem .imgList .pictrue{
position: relative;
width: 300rpx;
.play-icon {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: auto;
width: 80rpx;
height: 80rpx;
}
}
</style> </style>