Autoplay Twitter videos with sound
Posted on
It might be annoying scroll Twitter videos and click on each to hear sound. Here is the quick hack. It will unmute video when you hover and mute again when your cursor is out video.
- Install Custom JavaScript for websites plugin
- Go to twitter.com
- Open Custom JavaScript for websites plugin and paste this code:
window.addEventListener('mouseover', ({ target }) => {
if (target.tagName === 'VIDEO') {
target.muted = false
}
})
window.addEventListener('mouseout', ({ target }) => {
if (target.tagName === 'VIDEO') {
target.muted = true
}
})