From 9651c9cb6fcc4a1d947b91475dae85765400faa5 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 17 Jan 2025 18:19:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dh5=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/my-video-list/list-item.vue | 14 ++- components/my-video-list/my-video-list.vue | 104 ++++++++------------- 2 files changed, 47 insertions(+), 71 deletions(-) diff --git a/components/my-video-list/list-item.vue b/components/my-video-list/list-item.vue index 2d3f324..2e36de3 100644 --- a/components/my-video-list/list-item.vue +++ b/components/my-video-list/list-item.vue @@ -7,6 +7,7 @@ :show-play-btn="false" :controls="true" @click.stop="videoClick()" + @loadedmetadata="loadedmetadata" @timeupdate="timeupdate" @waiting="waiting()" object-fit="cover" @pause="onpause" @play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2" :show-loading="true" codec="software" :muted="false" :loop="loop" @@ -17,7 +18,7 @@ mode="aspectFill"> - + @@ -181,6 +182,11 @@ function waiting() { } + + let videoIsLoadedmetadata=ref(false) + function loadedmetadata(){ + videoIsLoadedmetadata.value=true + } let isPlying = ref(false) @@ -211,9 +217,7 @@ function timeupdate(e) { //隐藏loding - // #ifdef H5 uni.hideLoading() - // #endif if (isPlayFinish) { return } @@ -308,7 +312,9 @@ } const showVideo = computed(() => { if(props.isAndriod){ - return props.nowIndex === props.index && props.item.videoUrl ?true :false + console.log('props.nowIndex === props.index '); + console.log(props.nowIndex,props.index ); + return (props.nowIndex === props.index && props.item.videoUrl) ?true :false }else{ return props.current === props.index && props.item.videoUrl } diff --git a/components/my-video-list/my-video-list.vue b/components/my-video-list/my-video-list.vue index 7ae1af1..48fdca4 100644 --- a/components/my-video-list/my-video-list.vue +++ b/components/my-video-list/my-video-list.vue @@ -1,37 +1,36 @@