Skip to content

Commit

Permalink
Close GH-727: Fixed windowLoaded not setting on async script load. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmumm authored and heff committed Sep 9, 2013
1 parent a49213e commit a94259c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ vjs.autoSetupTimeout = function(wait){
setTimeout(vjs.autoSetup, wait);
};

vjs.one(window, 'load', function(){
if (document.readyState === 'complete') {
vjs.windowLoaded = true;
});
} else {
vjs.one(window, 'load', function(){
vjs.windowLoaded = true;
});
}

// Run Auto-load players
// You have to wait at least once in case this script is loaded after your video in the DOM (weird behavior only with minified version)
Expand Down

0 comments on commit a94259c

Please sign in to comment.