html video 循環(huán)播放(連續(xù)播放)
這個是vue的寫法,基本一致,添加兩個監(jiān)聽器,在數(shù)據(jù)準備好的時候再調(diào)用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();