當 seeking 屬性設為 true 時,指示 HTML 中的尋找處於活動狀態,執行一個指令碼?


在 HTML 中,使用 onseeking 屬性來指示影片中的查詢處於活動狀態。

示例

您可以嘗試執行以下程式碼,當 seeking 屬性設為 true 時,指示 HTML 中的查詢處於活動狀態,執行一個指令碼 −

<!DOCTYPE html>
<html>
   <body>
      <video controls onseeking = "display()">
         <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>
      <script>
         function display() {
            alert("Seeking starts!");
         }
      </script>
   </body>
</html>

更新於: 2020-5-29

93 次瀏覽

開啟職業生涯

完成課程獲得認證

開始
廣告
© . All rights reserved.