Play 等待 屬性在視訊暫停並緩衝以再次恢復時觸發。您可以嘗試執行以下程式碼來實作onwaiting 屬性 - 以上是當媒體暫停但預計在HTML中恢復時執行腳本的詳細內容。更多資訊請關注PHP中文網其他相關文章!當媒體暫停但預計在HTML中恢復時執行腳本
#範例
<!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>