Soundcloud API / SoundManager2 SetPosition not working before track is playing

I am trying to set the position of a sample in SoundCloud using setPosition to play from a certain time when I call the play() method. I need to set this before the sample starts playing. Right now this code isn't working:

SC.whenStreamingReady(function() {
            var sound = SC.stream("/tracks/141543551");
            sound.play();
            sound.setPosition(300);
        });

However, when I call setPosition while the sample is playing it works just fine.

SC.whenStreamingReady(function() {
                setTimeout(function () {

                sound.pause();

                var positionCallback = function (eventPosition) {
                    this.clearOnPosition(0, positionCallback);
                    this.resume();
                };
                sound.onPosition(0, positionCallback);
                sound.setPosition(30000);


                sound.play();

 }, 5000);

    });

How can I setPosition() before the sample plays?

Answers:

Answer

The docs that I found here http://www.schillmania.com/projects/soundmanager2/doc/

Say that this sound.setPosition(300); should look like sound.setPosition('position-name', 300); instead.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.