如何在 HTML 中指定音訊/影片在播放完畢後重新開始播放?
使用 loop 屬性指定音訊/影片會重新開始播放。你可以嘗試執行下面的程式碼實現 loop 屬性 −
示例
<!DOCTYPE HTML> <html> <body> <video width = "300" height = "200" controls loop> <source src = "/html5/foo.ogg" type = "video/ogg" /> <source src = "/html5/foo.mp4" type = "video/mp4" /> Your browser does not support the video element. </video> </body> </html>
廣告