当前位置: 代码迷 >> HTML/CSS >> HTML5学习札记(一):video,audio
  详细解决方案

HTML5学习札记(一):video,audio

热度:293   发布时间:2012-09-02 21:00:34.0
HTML5学习笔记(一):video,audio
            function toggleVideo(){
                var oVideo = document.getElementById("myVideo");
                if (oVideo) {
                    document.body.removeChild(oVideo);
                }
                else {
                    oVideo = document.createElement("video");
                    oVideo.src = "medias/1.m4v";//MP4格式
                    oVideo.controls = "controls";//鼠标可以控制
                    oVideo.autoplay = "true";//是否页面加载后就自动播放
                    oVideo.loop = "loop";//是否循环播放
                    oVideo.id = "myVideo";
                    document.body.appendChild(oVideo);
                }
            }
?