1.控制台报错: Uncaught (in promise) AbortError: The play() request was interrupted by a call to pause()
执行了play()方法以后立即执行了pause()方法,所以你让video暂停150毫秒之后再播放就不会报错了
if(video.paused || video.ended){setTimeout(() => {video.play();}, 200)}else{video.pause();}
1.控制台报错: Uncaught (in promise) AbortError: The play() request was interrupted by a call to pause()
执行了play()方法以后立即执行了pause()方法,所以你让video暂停150毫秒之后再播放就不会报错了
if(video.paused || video.ended){setTimeout(() => {video.play();}, 200)}else{video.pause();}