Skip to content

Commit

Permalink
Merge pull request #89 from basil79/adpod-refactoring
Browse files Browse the repository at this point in the history
fixed set volume for iOS
  • Loading branch information
basil79 committed Feb 6, 2023
2 parents f9d5f2a + 333126b commit be14a97
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/ads-manager.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ads-manager.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h3>Ad Events:</h3>
<br/>
<br/>

<script src="js/ads-manager.js?v=14"></script>
<script src="js/ads-manager.js?v=21"></script>
<script src="js/index.js?v=20"></script>


Expand Down
2 changes: 1 addition & 1 deletion public/js/ads-manager.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/ads-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1060,13 +1060,15 @@ AdsManager.prototype.setVolume = function(volume) {
if (this._isVPAID) {
this._isCreativeFunctionInvokable('setAdVolume') && this._vpaidCreative.setAdVolume(volume);
}
const isVolumeChanged = volume !== this._videoSlot.volume;
const isVolumeChanged = volume !== (this._videoSlot.muted ? 0 : this._videoSlot.volume);
if(isVolumeChanged) {
this._attributes.volume = volume;
if(volume !== 0) {
if(this._attributes.volume !== 0) {
this._videoSlot.muted = false;
} else {
this._videoSlot.muted = true;
}
this._videoSlot.volume = volume;
this._videoSlot.volume = this._attributes.volume;
this.onAdVolumeChange();
}
}
Expand Down

0 comments on commit be14a97

Please sign in to comment.