Skip to content

Commit

Permalink
Merge pull request mediaelement#812 from realgravity/fullscreen_timeo…
Browse files Browse the repository at this point in the history
…ut_fix

Clear timeout for second fullscreen stretch attempt
  • Loading branch information
johndyer committed Apr 9, 2013
2 parents 0a6eb16 + 2bd7e30 commit bb2bce5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/mep-feature-fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@
player.exitFullScreen();
},

containerSizeTimeout: null,

enterFullScreen: function() {

var t = this;
Expand Down Expand Up @@ -366,7 +368,7 @@
// Only needed for safari 5.1 native full screen, can cause display issues elsewhere
// Actually, it seems to be needed for IE8, too
//if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
setTimeout(function() {
t.containerSizeTimeout = setTimeout(function() {
t.container.css({width: '100%', height: '100%'});
t.setControlsSize();
}, 500);
Expand Down Expand Up @@ -404,6 +406,9 @@

var t = this;

// Prevent container from attempting to stretch a second time
clearTimeout(t.containerSizeTimeout);

// firefox can't adjust plugins
if (t.media.pluginType !== 'native' && mejs.MediaFeatures.isFirefox) {
t.media.setFullscreen(false);
Expand Down

0 comments on commit bb2bce5

Please sign in to comment.