Skip to content

Commit

Permalink
Merge pull request #90 from basil79/correct-ios-detection-ipados
Browse files Browse the repository at this point in the history
fixed getVolume for iOS, on iOS the video slot volume is always 1 eve…
  • Loading branch information
basil79 committed Feb 10, 2023
2 parents be14a97 + 0a373b0 commit 05b23b1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ads-manager",
"version": "1.2.4",
"version": "1.2.5",
"description": "HTML5 Video Ads Manager based on @dailymotion/vast-client",
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
6 changes: 3 additions & 3 deletions public/js/ads-manager.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/ads-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ AdsManager.prototype.showSlot = function() {
this._slot.style.display = 'block';
};
AdsManager.prototype.hideSlot = function() {
// Show slot
// Hide slot
this._slot.style.display = 'none';
};
AdsManager.prototype.resizeSlot = function(width, height) {
Expand Down Expand Up @@ -1052,7 +1052,9 @@ AdsManager.prototype.getVolume = function() {
if (this._isVPAID) {
return this._isCreativeFunctionInvokable('getAdVolume') ? this._vpaidCreative.getAdVolume() : -1;
}
return this._videoSlot.volume;
// on iOS the video slot volume is always 1 even if the video slot is muted,
// if video slot is muted, return 0, otherwise volume
return this._videoSlot.muted ? 0 : this._videoSlot.volume;
}
};
AdsManager.prototype.setVolume = function(volume) {
Expand Down

0 comments on commit 05b23b1

Please sign in to comment.