修复了返回播放

This commit is contained in:
luyuan 2020-09-03 11:57:40 +08:00
parent 7e9791ef18
commit e7a2a716b4
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3

View File

@ -1,6 +1,6 @@
<template>
<view>
<video :src="url" class="vodio" autoplay="true" :show-fullscreen-btn="false" :show-play-btn="false" :enable-progress-gesture="false" :show-center-play-btn="false" :show-progress="false" :controls="false" :style="{'height':height}" @error="errors">
<video :src="url" class="vodio" :autoplay="true" id="myVideo" :show-fullscreen-btn="false" :show-play-btn="false" :enable-progress-gesture="false" :show-center-play-btn="false" :show-progress="false" :controls="false" :style="{'height':height}" @error="errors">
</video>
<view class="user" :style="{'top': top}">
@ -337,7 +337,8 @@ export default {
danmu:false,
room:{},
chatRoomService:{},
danmulist:[]
danmulist:[],
videoContext:{}
};
},
onBackPress(options) {
@ -347,14 +348,10 @@ export default {
return false;
},
onShow(){
if(this.url != '' && this.url){
let url = this.url
this.url = ""
this.url = url
}
this.videoContext.play()
},
onLoad(a) {
this.videoContext = uni.createVideoContext('myVideo')
this.url = a.url;
this.id = a.id
console.log(this.url);