Add the ability to know if fullscreen is available
authorGilles Dubuc <gdubuc@wikimedia.org>
Fri, 31 Jan 2014 09:48:57 +0000 (10:48 +0100)
committerGilles Dubuc <gdubuc@wikimedia.org>
Thu, 6 Feb 2014 10:03:24 +0000 (11:03 +0100)
Not all browsers support fullscreen and for mmv
we need to display/hide the fullscreen button accordingly

Change-Id: I693477dfcadd168ae5930691750b709444eda644
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/152
Github: https://github.com/theopolisme/jquery-fullscreen/pull/6

resources/jquery/jquery.fullscreen.js

index 0159079..3d1f29a 100644 (file)
         * Return false if fullscreen is not supported.
         */
        setupFullscreen = function () {
-               if ( document.fullscreenEnabled ||
-                               document.mozFullScreenEnabled ||
-                               document.webkitFullscreenEnabled ||
-                               document.msFullscreenEnabled
-               ) {
+               if ( $.support.fullscreen ) {
                        // When the fullscreen mode is changed, trigger the
                        // fullscreen events (and when exiting,
                        // also remove the fullscreen class)
                        return this;
                }
        };
+       
+       $.support.fullscreen = document.fullscreenEnabled ||
+               document.webkitFullscreenEnabled ||
+               document.mozFullScreenEnabled ||
+               document.msFullscreenEnabled;
 }( jQuery ) );