Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

support gecko mozRequestFullScreen api. #18

Merged
merged 1 commit into from

2 participants

@Pike

Support the fullscreen api added in Gecko 9.

Make sure that you have full-screen-api.enabled set to true in about:config for now.

@Pike Pike support mozRequestFullScreen experimental api
Support the fullscreen api added in Gecko 9. Make sure that you have
full-screen-api.enabled set to true.
3158424
@maccman maccman merged commit f7b96fc into from
@maccman
Owner

Thanks

@Pike

Sweet, thanks for the quick turnaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 9, 2011
  1. @Pike

    support mozRequestFullScreen experimental api

    Pike authored
    Support the fullscreen api added in Gecko 9. Make sure that you have
    full-screen-api.enabled set to true.
This page is out of date. Refresh to see the latest.
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(){
Something went wrong with that request. Please try again.