视频列表组件代码更新
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||
@waiting="waiting()" object-fit="cover"
|
||||
@pause="onpause"
|
||||
@click="videoClick()"
|
||||
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
||||
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="false"
|
||||
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
||||
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
|
||||
|
||||
<image class="poster" v-else @click="!item.videoUrl?popupShow('pay'):''" :src="item.titleImg" mode="aspectFill">
|
||||
<image class="poster" v-else @click="!item.videoUrl?popupShow('pay',item):''" :src="item.titleImg" mode="aspectFill">
|
||||
</image>
|
||||
|
||||
<view class="info" v-if="!isCommand" :style="infoStyle">
|
||||
@@ -150,8 +151,11 @@
|
||||
function waiting() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
let isPlying=false
|
||||
function videoPlay() {
|
||||
isPlying=true
|
||||
// #ifdef H5
|
||||
emits('controlstoggles', {
|
||||
detail:{show:true}
|
||||
@@ -161,6 +165,7 @@
|
||||
}
|
||||
|
||||
function onpause(){
|
||||
isPlying=false
|
||||
// #ifdef H5
|
||||
emits('controlstoggles', {
|
||||
detail:{show:false}
|
||||
@@ -187,7 +192,16 @@
|
||||
function popupShow(key) {
|
||||
emits('popupShow', key)
|
||||
}
|
||||
|
||||
function videoClick(){
|
||||
if(video){
|
||||
if(isPlying){
|
||||
video.pause()
|
||||
}else{
|
||||
video.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let first = true
|
||||
|
||||
function appear() {
|
||||
|
||||
Reference in New Issue
Block a user