AbortError: The play() request was interrupted by a new load request

这个表示 你的视频还没有准备好 你就开始播放了

要不就是 你播放之后离立即暂停了 视频没有反应过来

 其实最好的是 等视频准备好 150毫秒之内播放就成

我再uniapp中的生命钩子函数中调用 视频播放方法

onReady(){
            this.videoContext=uni.createVideoContext('myVideo',this);
           this.videoContext.play();
        }

上面写就会报错改成下面的 就可以 等视频准备就绪 视频标签 本来兼容性问题就比较大 还有一个准备就绪的时间

onReady(){
            this.videoContext=uni.createVideoContext('myVideo',this);
            if(this.index===0){
                setTimeout(()=>{
                    this.videoContext.play();
                },150)
            }
        },

发布了168 篇原创文章 · 获赞 65 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/yunchong_zhao/article/details/104375254