Skip to content

Commit

Permalink
feat(FEC-7171): handle preload when ads plugin enabled (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv authored Sep 20, 2017
1 parent 59c3a5d commit 75e8139
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,15 @@ export default class Player extends FakeEventTarget {
this.playsinline = true;
}
if (this._config.playback.preload === "auto") {
this.load();
/**
* If ads plugin enabled it's his responsibility to preload the content player.
* So to avoid loading the player twice which can cause errors on MSEs we are not
* calling load from the player.
* TODO: Change it to check the ads configuration when we will develop the ads manager.
*/
if (!this._config.plugins.ima) {
this.load();
}
}
if (this._canAutoPlay()) {
this.play();
Expand Down

0 comments on commit 75e8139

Please sign in to comment.