您可以對以下屬性使用oncanplay屬性 -
<!DOCTYPE HTML> <html> <body> <video width = "300" height = "200" controls oncanplay = "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> alert("I am ready to begin."); </script> </body> </html>#
以上是當檔案準備好在HTML中開始播放時執行腳本嗎?的詳細內容。更多資訊請關注PHP中文網其他相關文章!