码迷,mamicode.com
首页 > Web开发 > 详细

js 开启video全屏模式

时间:2015-08-18 13:44:37      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:

方法一:

                function launchFullScreen() {
                    var element = document.documentElement;
                    if(element.requestFullScreen) {
                        element.requestFullScreen();  
                    } else if(element.mozRequestFullScreen) { 
                        element.mozRequestFullScreen();  
                    } else if(element.webkitRequestFullScreen) {
                        element.webkitRequestFullScreen();  
                    }
                }                

 方法二:

              function fullScreen() { 
                    var el = document.documentElement; 
                    var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; 
                    if (typeof rfs != "undefined" && rfs) { 
                        rfs.call(el);
                    } else if (typeof window.ActiveXObject != "undefined") { 
                        // for Internet Explorer 
                        var wscript = new ActiveXObject("WScript.Shell"); 
                        if (wscript != null) { 
                            wscript.SendKeys("{F11}"); 
                        } 
                    } 

                } 

 

js 开启video全屏模式

标签:

原文地址:http://www.cnblogs.com/share123/p/4738897.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!