|
@@ -42,7 +42,7 @@
|
|
|
:src="item.video_url"
|
|
|
enable-play-gesture
|
|
|
:id="item.community_video_id"
|
|
|
- @ended="curVideoId=0"
|
|
|
+ @ended="handleVideoEnd"
|
|
|
v-if="item.community_video_id==curVideoId"
|
|
|
></video>
|
|
|
<image @click="handelClickPlay(item)" v-else class="poster" :src="item.cover_img_url" mode="aspectFill" lazy-load/>
|
|
@@ -111,6 +111,7 @@ export default {
|
|
|
list:[],
|
|
|
|
|
|
curVideoId:0,
|
|
|
+ curVideoIns:null
|
|
|
}
|
|
|
},
|
|
|
onLoad(options){
|
|
@@ -220,12 +221,24 @@ export default {
|
|
|
|
|
|
handelClickPlay(item){
|
|
|
this.curVideoId=item.community_video_id
|
|
|
+ setTimeout(() => {
|
|
|
+ this.curVideoIns=uni.createVideoContext(this.curVideoId.toString())
|
|
|
+ }, 300);
|
|
|
// 记录播放
|
|
|
apiVideoPlayLog({video_id:Number(item.community_video_id)}).then(res=>{
|
|
|
if(res.code===200){
|
|
|
console.log('视频埋点成功');
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+
|
|
|
+ //视频播放结束
|
|
|
+ handleVideoEnd(){
|
|
|
+ this.curVideoIns.exitFullScreen()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.curVideoId=0
|
|
|
+ this.curVideoIns=null
|
|
|
+ }, 200);
|
|
|
}
|
|
|
},
|
|
|
}
|