我想知道如果任何人都可以提供示例如何使用Firefox的新全屏(不只是全窗口)模式API的JavaScript/jQuery代碼(請參閱下面的鏈接)。基本上我想點擊一些會導致視頻全屏的東西。Firefox/Gecko全屏API與HTML5視頻(javascript/jQuery)
基於它看起來像我應該能夠做到像什麼,我知道在Safari作品(和開發建立Chrome瀏覽器)的API:
$(function(){
$('#full').click(function(){
var video_player = document.getElementById("video");
video_player.onwebkitfullscreenchange = function(){};
video_player.webkitRequestFullScreen();
});
});
UPDATE正如亞歷山大提議,今晚( 11/10/11)我安裝了Firefox 10的 「每晚」 構建和下面的代碼現在工作:
$(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
嗨亞歷山大,感謝您的信息,我會繼續關注FF10,再次感謝! -tim –
這沒有提供答案。而且,現在也可以在webkit中使用全屏,對於Chrome 15。 –
這提供了答案。他已經知道,腳本是如何在webkit和Firefox中使用全屏API的。這篇文章已經有完整的文檔鏈接。他只是苦於事實,即使用API在FF7/8/9中不起作用。 –