当文件准备好在HTML中开始播放时执行脚本吗?
原创
您可以对以下属性使用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中开始播放时执行脚本吗?的详细内容,更多请关注IT视界其它相关文章!