当前位置: 代码迷 >> 综合 >> video播放Uncaught (in promise) AbortError: The play() request was interrupted by a call to pause()
  详细解决方案

video播放Uncaught (in promise) AbortError: The play() request was interrupted by a call to pause()

热度:55   发布时间:2024-02-08 11:51:02.0

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();}
  相关解决方案