小程序的使用同一个video组件播放用户选择的不同视频,切换时,会闪现上一个视频
发布于 6 年前 作者 zhaofang 9373 次浏览 来自 问答

手机:华为p20,vivo x9 等,以上截图上方是一个video组件,下方是切换视频播放的icon。video设置大致如下代码:

<video

      src="{{allVideo[currentIndex].url}}"

      show-fullscreen-btn="{{false}}"

      enable-progress-gesture="{{false}}"

      show-center-play-btn="{{true}}"

      show-progress="{{false}}"

      custom-cache="{{false}}"

      autoplay="{{true}}"

      objectFit=“cover”

       binderror=“handlePlayErr”

       poster="{{allVideo[currentIndex].view}}"

></video>

其中:allVideo是所有视频组成的数组,currentIndex是当前选中的视频索引。

    这里主要的bug是,切换播放资源的时候会闪现上一个视频的poster,然后再出现当前视频的poster,看起来像是更换video的poster有延迟导致的。

请问是什么原因导致的这个影响用户体验的现象?该如何解决?

2 回复

这不是BUG,这需要你自己处理,反正我已经做出来了

回到顶部