Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #18 from Pike/master

support gecko mozRequestFullScreen api.
  • Loading branch information...
commit f7b96fc2baf8069f5dfcb87152f391a509fa9e5a 2 parents c99d426 + 3158424
@maccman authored
Showing with 15 additions and 3 deletions.
  1. +15 −3 javascripts/flarevideo.js
View
18 javascripts/flarevideo.js
@@ -34,7 +34,11 @@ $.fn.idleTimer = function(options){
var testVideoElement = $("<video />")[0];
var nativeSupport = (typeof testVideoElement.canPlayType != 'undefined');
-var nativeFullScreenSupport = (typeof testVideoElement.webkitEnterFullScreen != 'undefined');
+var nativeFullScreenSupport = (
+ (typeof testVideoElement.webkitEnterFullScreen != 'undefined') ? 'webkit' :
+ (typeof testVideoElement.mozRequestFullScreen != 'undefined') ? 'mozGecko' :
+ false);
+
// webkitEnterFullScreen fails under Chrome at the moment
if (navigator.userAgent.match('Chrome')) nativeFullScreenSupport = false;
@@ -142,14 +146,22 @@ FlareVideo.fn.togglePlay = function(){
FlareVideo.fn.fullScreen = function(state){
if (typeof state == "undefined") state = true;
this.inFullScreen = state;
- if (this.options.useNativeFullScreen) {
+ switch (this.options.useNativeFullScreen) {
+ case 'webkit': {
this.video[state ? "enterFullScreen" : "exitFullScreen"]();
- } else {
+ break;
+ }
+ case 'mozGecko': {
+ this.video[state ? "mozRequestFullScreen" : "mozCancelFullScreen"]();
+ break;
+ }
+ default: {
(state ? $("body") : this.parent).prepend(this.element);
var isPlaying = (this.state == "playing");
this.element[state ? "addClass" : "removeClass"]("fullScreen");
if (isPlaying) this.ready($.proxy(this.play, this));
}
+ }
};
FlareVideo.fn.toggleFullScreen = function(){
Please sign in to comment.
Something went wrong with that request. Please try again.