Skip to content

Commit

Permalink
fix: Fix undefined isMobile in sdk-impl. Fixes #541 (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnbuso committed Mar 1, 2018
1 parent 23d01fb commit e7dd9c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/controller.js
Expand Up @@ -115,6 +115,17 @@ Controller.prototype.getSettings = function() {
return this.settings;
};


/**
* Return whether or not we're in a mobile environment.
*
* @return {boolean} True if running on mobile, false otherwise.
*/
Controller.prototype.getIsMobile = function() {
return this.isMobile;
};


/**
* Inject the ad container div into the DOM.
*
Expand Down
2 changes: 1 addition & 1 deletion src/sdk-impl.js
Expand Up @@ -277,7 +277,7 @@ SdkImpl.prototype.onAdsManagerLoaded = function(adsManagerLoadedEvent) {
google.ima.AdEvent.Type.SKIPPED,
this.onAdComplete.bind(this));

if (this.isMobile) {
if (this.controller.getIsMobile()) {
// Show/hide controls on pause and resume (triggered by tap).
this.adsManager.addEventListener(
google.ima.AdEvent.Type.PAUSED,
Expand Down

0 comments on commit e7dd9c8

Please sign in to comment.