使用 onseeking 属性来指示 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>