当 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.