Skip to content

Instantly share code, notes, and snippets.

@propagated
Last active January 25, 2025 01:17
Show Gist options
  • Save propagated/78aaedfbc0c23add7691bb975b51a3ff to your computer and use it in GitHub Desktop.
Save propagated/78aaedfbc0c23add7691bb975b51a3ff to your computer and use it in GitHub Desktop.
control soundcloud embed volume
//load soundcloud js api if needed
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://w.soundcloud.com/player/api.js';
document.head.appendChild(script);
//get the id of the player iframe or inject it using chrome
var id = 'scplayer',
widgetIframe = document.getElementById(id),
fixWidget = SC.Widget(widgetIframe);
fixWidget.setVolume(50); //% between 1 and 100
@AncientVipers
Copy link

I've put in the soundcloud embed from soundcloud itself (from my song)
Loaded the script, before the embed loads. and it does not control any sounds whatsoever.

How to fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment