精选!html video 循环播放(连续播放)
来源:哔哩哔哩
发布日期:2023-02-14 21:00:17
(资料图片)
这个是vue的写法,基本一致,添加两个监听器,在数据准备好的时候再调用play 这样就不会被浏览器卡住了
We fixed this problem by registering a loadeddata
event listener on the video element that we were trying to play, then load()
ing the video, and finally play()
ing it inside the event handler:
const playVideo = (video) => { video.addEventListener('loadeddata', () => { video.play(); }); video.load();