【发布时间】:2011-11-30 03:38:07
【问题描述】:
我想知道是否有人可以向我提供如何使用 Firefox 的新全屏(不仅仅是全窗口)模式 API 的示例 javascript/jquery 代码(请参见下面的链接)。基本上我想点击一些会导致视频全屏显示的东西。
基于 API,看起来我应该能够做一些我知道在 Safari(和 Chrome 的开发版本)中有效的东西:
$(function(){
$('#full').click(function(){
var video_player = document.getElementById("video");
video_player.onwebkitfullscreenchange = function (){};
video_player.webkitRequestFullScreen();
});
});
更新按照 Alexander 的建议,今晚(2011 年 11 月 10 日)我安装了 Firefox 10 的“Nightly”版本,现在可以使用以下代码:
$(function(){
$('#full').click(function(){
var video_player = document.getElementById("video");
void video_player.mozRequestFullScreen(); //firefox nightly build as of 11/10/11
});
});
http://blog.pearce.org.nz/2011/11/firefoxs-html-full-screen-api-enabled.html
https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI#requestFullScreen_method
【问题讨论】:
标签: jquery firefox fullscreen html5-video