當 seeking 屬性設定為 false 時執行指令碼,表明 HTML 中的搜尋已結束?


在使用者跳過或移動到音影片的新位置時,將執行 onseeked 屬性。

示例

你可以嘗試執行以下程式碼以實施 onseeked 屬性 −

<!DOCTYPE html>
<html>
   <body>
      <h2 id = "test">Play</h2>
      <video id = "myid" width = "320" height = "176" controls onseeked = "myFunction()">
         <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 myFunction() {
         document.getElementById("test").innerHTML = "Current position: " +
         document.getElementById("myid").currentTime;
         }
      </script>
   </body>
</html>

更新於: 03-Mar-2020

138 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.