修复ios视频兼容性问题,改为同h5播放形式
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="item" @appear="appear" @disappear="disappear" @click.stop :style="{height:height+'px'}">
|
||||
<view class="item" @appear="appear" @disappear="disappear" @click.stop :style="{height:height+'px'}" :key="index">
|
||||
|
||||
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||
play-btn-position="center"
|
||||
@@ -78,6 +78,10 @@
|
||||
// #endif
|
||||
|
||||
const props = defineProps({
|
||||
isAndriod:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
height:{
|
||||
type:Number,
|
||||
default:0
|
||||
@@ -296,19 +300,18 @@
|
||||
|
||||
let video = null
|
||||
|
||||
function disappear() {
|
||||
emits('disappear')
|
||||
function disappear(e) {
|
||||
emits('disappear',e)
|
||||
if (video) {
|
||||
video.pause()
|
||||
}
|
||||
}
|
||||
const showVideo = computed(() => {
|
||||
// #ifdef H5
|
||||
return props.current === props.index && props.item.videoUrl
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
return props.nowIndex === props.index && props.item.videoUrl ?true :false
|
||||
// #endif
|
||||
if(props.isAndriod){
|
||||
return props.nowIndex === props.index && props.item.videoUrl ?true :false
|
||||
}else{
|
||||
return props.current === props.index && props.item.videoUrl
|
||||
}
|
||||
})
|
||||
onMounted(() => {
|
||||
init()
|
||||
|
||||
Reference in New Issue
Block a user