I'm wondering if anyone can provide me with example javascript/jquery code of how to use Firefox's new fullscreen (NOT just full window) mode API (see link below). Basically i'd like to click something that would cause the video to go full screen.

Based on the API it looks like i should be able to do something like what i know works in Safari (and Dev builds of Chrome):

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

UPDATE As suggested by Alexander, tonight (11/10/11) I installed the "Nightly" build of Firefox 10 and the following code now 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

share|improve this question

1 Answer

up vote 1 down vote accepted

This feature is currently not part of FF 7/8/9. It will be implemented with FF10, you will have to wait for 6-8 weeks to test your code in the aurora channel. You can also use the nightly channel

share|improve this answer
hi Alexander, thanks for the info, i'll keep a look out for FF10, thanks again! -tim – tim peterson Oct 3 '11 at 20:06
This didn't provide the answer. And fullscreen is possible in webkit right now as well, for chrome 15. – android.nick Nov 6 '11 at 3:06
This provides the answer. He already knew, how the script the fullscreen API in webkit and Firefox. There is already a full documentation link in the post. He was only struggling with the fact, that using the API did not work in FF7/8/9. – alexander farkas Nov 6 '11 at 12:23

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.