Firefox / Gecko fullscreen API with HTML5 Video (javascript / jQuery)

I am wondering if anyone can provide me a javascript / jquery sample code on how to use the new full-screen (full-window only) Firefox API (see link below). Basically, I would like to click on something that will cause the video to go full screen.

Based on the API, it looks like I can do something like what I know works in Safari (and Chrome's Chrome Dev builds):

$(function(){ $('#full').click(function(){ var video_player = document.getElementById("video"); video_player.onwebkitfullscreenchange = function (){}; video_player.webkitRequestFullScreen(); }); }); 

UPDATE As Alexander suggested, tonight (11/10/11) I installed the "Nightly" build of Firefox 10, and now the following code works:

 $(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

+4
source share
1 answer

This feature is currently not part of FF 7/8/9. It will be implemented using FF10, you will need to wait 6-8 weeks to check your code on the aurora channel. You can also use the night channel

+1
source

All Articles