diff options
author | Sam Potts <sam@potts.es> | 2018-03-11 18:23:47 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-03-11 18:23:47 +1100 |
commit | 9981c349be60157dbaeaa3123a6ce44f312dc27a (patch) | |
tree | 5d462b380728829600e1f4d30db1eeae1ba8127b /dist/plyr.polyfilled.js | |
parent | b3365a7373a788453710d0601d664b3856f68307 (diff) | |
download | plyr-9981c349be60157dbaeaa3123a6ce44f312dc27a.tar.lz plyr-9981c349be60157dbaeaa3123a6ce44f312dc27a.tar.xz plyr-9981c349be60157dbaeaa3123a6ce44f312dc27a.zip |
Fix for null manager race condition
Diffstat (limited to 'dist/plyr.polyfilled.js')
-rw-r--r-- | dist/plyr.polyfilled.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/dist/plyr.polyfilled.js b/dist/plyr.polyfilled.js index 9e5968c8..d9c20dd0 100644 --- a/dist/plyr.polyfilled.js +++ b/dist/plyr.polyfilled.js @@ -10340,7 +10340,7 @@ var Ads = function () { if (this.enabled) { // Check if the Google IMA3 SDK is loaded or load it ourselves - if (!utils.is.object(window.google)) { + if (!utils.is.object(window.google) || !utils.is.object(window.google.ima)) { utils.loadScript(this.player.config.urls.googleIMA.api).then(function () { _this2.ready(); }).catch(function () { @@ -10452,8 +10452,6 @@ var Ads = function () { request.forceNonLinearFullSlot = false; this.loader.requestAds(request); - - this.trigger('loaded'); } catch (e) { this.onAdError(e); } @@ -10493,7 +10491,7 @@ var Ads = function () { }, { key: 'onAdsManagerLoaded', - value: function onAdsManagerLoaded(adsManagerLoadedEvent) { + value: function onAdsManagerLoaded(event) { var _this6 = this; // Get the ads manager @@ -10505,7 +10503,7 @@ var Ads = function () { // The SDK is polling currentTime on the contentPlayback. And needs a duration // so it can determine when to start the mid- and post-roll - this.manager = adsManagerLoadedEvent.getAdsManager(this.player, settings); + this.manager = event.getAdsManager(this.player, settings); // Get the cue points for any mid-rolls by filtering out the pre- and post-roll this.cuePoints = this.manager.getCuePoints(); @@ -10748,7 +10746,7 @@ var Ads = function () { if (!this.managerPromise) { - return; + this.resumeContent(); } // Play the requested advertisement whenever the adsManager is ready @@ -10772,7 +10770,7 @@ var Ads = function () { // VAST response _this9.onAdError(adError); } - }); + }).catch(function () {}); } /** @@ -10857,7 +10855,7 @@ var Ads = function () { // Now request some new advertisements _this10.requestAds(); - }); + }).catch(function () {}); } /** |