I’m frustrated

Is there anyway to create a Rewind / Forward buttons?

I'm trying to create a rewind and forward button for the player but i don't get it to work :(

I was trying to use the code this guys were discused here http://getsatisfaction.com/schillmani... but i can't get it working.

Is there anyone that could help me to do so?? i attempted to use setPosition but i suck so it didn't work. I mean it allowed me to start from the time y set but i want to be able to click in the button and ADD the time or percentage i have in the funcction to the current position that is playing.
1 person has
this question
+1
Reply
  • Scott (Official Rep) July 28, 2011 02:51
    Setting position can get a bit tricky while a sound is still loading, but if you wanted to have a function that does a seek by a relative position while a sound is playing, something like this might work..
    function relativeSeek(soundID, percent) {
    // given a sound, seek by a percentage of the total duration.
    var s = soundManager.getSoundById(soundID);
    if (!s || !s.playState || !s.duration) {
    return false;
    }
    s.setPosition(s.position + (s.duration * (percent/100)));
    }
    // for example...
    relativeSeek('mySound', 10); // "fast forward" 10%
    relativeSeek('mySound', -5); // "rewind" 5%
    Side disclaimer/note: I wrote this off the top of my head, but it should work. ;)

    If you want to simply have a sound start from the beginning while it's playing, you can call
    soundManager.setPosition('mySound', 0);
    or whatever the relevant sound ID is.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I’m thankful
    DUDE YOU'ARE AWESOME IT WORKS THE WAY I WANTED YAAAAAY :D
    thanks for your help and time :)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited