Skip to content

Instantly share code, notes, and snippets.

@Syynth
Last active December 23, 2022 19:30
Show Gist options
  • Save Syynth/bbe7be8e2fafd0b9f51fa2c744d161c8 to your computer and use it in GitHub Desktop.
Save Syynth/bbe7be8e2fafd0b9f51fa2c744d161c8 to your computer and use it in GitHub Desktop.
Add volume slider to Overcast.fm player page
(() => {
const container = document.createElement('div');
container.innerHTML =
`<div>Volume</div>
<input type="range" value="1" min="0" step="0.01" max="1">`;
document.querySelector('#playcontrols_container').after(container);
const audio = document.querySelector('#audioplayer');
const volume = container.querySelector('input[type="range"]');
volume.addEventListener('change', event => {
audio.volume = (+event.target.value);
});
container.style.display = 'flex';
container.style.flexDirection = 'column';
container.style.alignItems = 'stretch';
container.style.textAlign = 'center';
container.style.accentColor = '#fc7e0f';
container.style.marginBottom = '20px';
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment