Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    85
    Thanks
    22
    Thanked 0 Times in 0 Posts

    webkit and mozilla full-screen mode

    I know this has only just been introduced lately, so if I use it, how can I test if a browser supports it?

    If I do something like the following, I believe I am testing if the browser is in full screen mode not whether or not the browser offers the functionality?

    Code:
    function FullScreenSupported() { 
    if (document.webkitIsFullScreen) {
        alert("webkitIsFullScreen is supported");/ 
     }else{
        alert("webkitIsFullScreen is not supported"); 
        }
    }
    Mozilla’s introduction to full screen mode is here:
    https://developer.mozilla.org/en/DOM...atibilityTable

    Thanks.

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,803
    Thanks
    19
    Thanked 157 Times in 148 Posts
    Wouldn't HTML5's implementation of full screen video be a more standardized, forward-compatible approach than using webkit? For example:

    http://www.html5-fullscreen-video.com/
    http://www.html5-fullscreen-video.co...screen/movie/2
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!

  • #3
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    Quote Originally Posted by Martins View Post
    I know this has only just been introduced lately, so if I use it, how can I test if a browser supports it?
    The document you linked to pretty much says it all:
    PHP Code:
    if (elem.requestFullScreen) {
      
    // Standard support
    } else if (elem.mozRequestFullScreen) {
      
    // Gecko support
    } else if (elem.webkitRequestFullScreen) {
      
    // Webkit support

    .My new Javascript tutorial site: http://reallifejs.com/
    .Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
    .Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback

  • #4
    New Coder
    Join Date
    Nov 2005
    Posts
    85
    Thanks
    22
    Thanked 0 Times in 0 Posts
    Thanks.

    I resolved this as:

    Code:
    document.webkitIsFullScreen != null


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •