Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mute Ads
clearInterval(aa)
function mv() {
var found_one = false
var primary = 0
let el = document.querySelectorAll('.mlbtv-media-player')[primary]
let has_ads = !!el.querySelector('.interruption-link')
if (!has_ads) {
el.querySelector('video').muted = false
found_one = true
} else {
el.querySelector('video').muted = true
}
document.querySelectorAll('.mlbtv-media-player').forEach((el, idx) => {
if (idx === primary) return
if (!found_one) {
let has_ads = !!el.querySelector('.interruption-link')
if (!has_ads) {
el.querySelector('video').muted = false
found_one = true
} else {
el.querySelector('video').muted = true
}
} else {
el.querySelector('video').muted = true
}
})
}
var aa = setInterval(mv, 1500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.