I've tried your code but to no avail.
My full code reads as following:
<iframe id="soundcloud_player" width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/1647126214&color=%23ff5500&auto_play=true"></iframe>
<script src="https://connect.soundcloud.com/sdk/sdk-3.3.2.js"></script>
<script>
$(document).ready(function(){
//Variable declaration
var player = SC.Widget($('iframe.sc-widget')[0]);
var randomVal;
//player initialisation
player.bind(SC.Widget.Events.READY, function() {
randomSong(player);
player.play();
});
//Set the random song
function randomSong(player) {
randomVal = Math.random() * 10;
for(i = 0; i < randomVal; i++)
{
player.next();
}
}
});
</script>
You can find it on cerculintreg.ro.
Any suggestion why it still starts linearly?