Skip to content

Commit

Permalink
fix(player): Fixed issue with non-existing Ads options
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa8626 committed Sep 13, 2018
1 parent 90729f3 commit e15cf09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/openplayer.js
Expand Up @@ -1316,7 +1316,8 @@ var Player = function () {
this.media.load();

if (this.ads) {
this.adsInstance = new ads_1.default(this.media, this.ads, this.autoplay, this.options.ads);
var adsOptions = this.options && this.options.ads ? this.options.ads : undefined;
this.adsInstance = new ads_1.default(this.media, this.ads, this.autoplay, adsOptions);
}
} catch (e) {
console.error(e);
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/js/player.ts
Expand Up @@ -554,7 +554,8 @@ class Player {
this.media.load();

if (this.ads) {
this.adsInstance = new Ads(this.media, this.ads, this.autoplay, this.options.ads);
const adsOptions = this.options && this.options.ads ? this.options.ads : undefined;
this.adsInstance = new Ads(this.media, this.ads, this.autoplay, adsOptions);
}
} catch (e) {
console.error(e);
Expand Down

0 comments on commit e15cf09

Please sign in to comment.