perminder-klair / angular-soundmanager2

SoundManager2 Music Player for AngularJs
http://perminder-klair.github.io/angular-soundmanager2/
MIT License
169 stars 108 forks source link

Problem while updating playlist #60

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello, i am facing a problem when i update my playlist run time. what i need to do is load songs based on user preferences. when my current song is playing and i load new songs my current playing song stops in mobile. When i use clearPlaylist it doesnt work but if i remove songs from playlist then it works fine in web but song stops in mobile. I want to load new songs without halting the current playing song. is there any way to start song from particular time ?? like play song from 1:10

here is my code ::

$timeout(function() { angularPlayer.clearPlaylist(function(result){ angularPlayer.addTrack(song); }); },0);

Please help.

NevenLeung commented 6 years ago

You can use the angular event to set this.

$rootScope.$broadcast('track:progress', trackProgress);

trackProgress is the number of played progress. The range of it is from 0 to 100. Calculate the progress number, and use the function above to set the position you want.

A better solution may be not clear the song playing, use removeSong() to remove other songs. When the song is finished, remove it later.