如何在 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>

更新於: 2020 年 6 月 24 日

283 次觀看

職業生涯起航

完成課程獲得認證

開始
廣告
© . All rights reserved.