Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update extensions/amp-story/1.0/media-pool.js
Co-authored-by: Gabriel Majoulet <gmajoulet@google.com>
  • Loading branch information
2 people authored and Ale Patron committed Nov 2, 2021
commit 03bc0adc6f78adb01219132f40491a01ff85a318
15 changes: 6 additions & 9 deletions extensions/amp-story/1.0/media-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,12 +852,9 @@ export class MediaPool {

// When a video is muted, reset its volume to the default value of 1.
if (mediaType == MediaType.VIDEO) {
let parent = domMediaEl.parentElement;
if (parent) {
domMediaEl.volume = 1;
}
domMediaEl.volume = 1;
}

return this.enqueueMediaElementTask_(poolMediaEl, new MuteTask());
}

Expand All @@ -879,11 +876,11 @@ export class MediaPool {
}

if (mediaType == MediaType.VIDEO) {
let parent = domMediaEl.parentElement;
if (parent) {
let volume = parent.getAttribute('volume');
const ampVideoEl = domMediaEl.parentElement;
if (ampVideoEl) {
const volume = ampVideoEl.getAttribute('volume');
if (volume) {
domMediaEl.volume = Number.parseFloat(volume);
domMediaEl.volume = parseFloat(volume);
}
}
}
Expand Down