Skip to content

Commit

Permalink
feat: Auto-populate setAdWillPlayMuted if not provided in settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnbuso committed Feb 7, 2018
1 parent 670360b commit b313873
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/sdk-impl.js
Expand Up @@ -221,6 +221,10 @@ SdkImpl.prototype.requestAds = function() {
(this.controller.getPlayerHeight() / 3);

adsRequest.setAdWillAutoPlay(this.controller.getSettings().adWillAutoPlay);
const adWillPlayMuted =
this.controller.getSettings().adWillPlayMuted !== undefined ?
this.controller.getSettings().adWillPlayMuted :
(this.controller.getPlayerVolume() == 0);
adsRequest.setAdWillPlayMuted(this.controller.getSettings().adWillPlayMuted);

this.adsLoader.requestAds(adsRequest);
Expand Down

0 comments on commit b313873

Please sign in to comment.