如何在 HTML 中設定影片靜音?


使用 muted 屬性可實現影片靜音。您可以嘗試執行以下程式碼來實現 muted 屬性 −

示例

<!DOCTYPE HTML>
<html>
   <body>
      <video width = "300" height = "200" controls muted>
         <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 年 3 月 3 日

345 次瀏覽

開啟你的 職業

透過完成課程獲得認證

開始
廣告