scottschiller / SoundManager2

A JavaScript Sound API supporting MP3, MPEG4 and HTML5 audio + RTMP, providing reliable cross-browser/platform audio control in as little as 12 KB. BSD licensed.
http://www.schillmania.com/projects/soundmanager2/
Other
4.99k stars 768 forks source link

can I set a start time/progress via bar-ui? #236

Open Rello opened 5 years ago

Rello commented 5 years ago

Hello,

I want to store the playtime of a title to restart on that position after restarting the player. is there a way to set the starting time/progress? I did not find any action.

any suggestion?

thank you!

Deiber commented 5 years ago

Hi @Rello, I implemented that using a variable into my cookies, so.. when you want to restart your player, before it, you have to set the variable with the current position/time that you want to and after that you can set the position for resume your player....

Regards!

Rello commented 5 years ago

Hello, thank you for your reply. but which variable of soundmanager do you use to hand over the resume position? I am storing the values in a database - but I am missing the restart thing...

Deiber commented 5 years ago

Hi @Rello check this Documentation MySound.setPosition(miliseconds), if your sound is paused or stopped set the position and call the property play(). In my case, before to resume the player, I set the position and after that play it!

I hope that this be useful for you!