Forked from propagated/soundcloudEmbedVolumeFix.js
Last active
October 6, 2020 22:29
-
-
Save codeanpeace/0d39fcbfe21ff890b344a8d66b48b18a to your computer and use it in GitHub Desktop.
turn down the dang volume of embedded soundcloud iframes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//load soundcloud js api if needed | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = 'https://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), | |
// updated for kosmi.io where iframe has no id or class | |
var widgetIframe = document.getElementsByTagName('iframe')[0], | |
fixWidget = SC.Widget(widgetIframe); | |
fixWidget.setVolume(50); //% between 1 and 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment