等待?屬性在視頻暫停并緩沖以再次恢復時觸發。您可以嘗試運行以下代碼來實現onwaiting?屬性 –
示例
<!DOCTYPE html> <html> <body> <h2 id = "test">Play</h2> <video id = "myid" width = "320" height = "176" controls onwaiting = "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 = "Media resumes again"; } </script> </body> </html>
登錄后復制
以上就是當媒體暫停但預計會在HTML中恢復時執行腳本的詳細內容,更多請關注www.92cms.cn其它相關文章!