perminder-klair / angular-soundmanager2

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

clear playlist takes too much time, let timeout be zero? #47

Open elprup opened 8 years ago

elprup commented 8 years ago

First, thanks for your effort on this great library.
I notice when I try to remove all songs from playlist which including 40+ songs, it always takes a long time. In clearPlaylist I notice the function loop setTimeout is 100ms, which is too long for long list. I modify it to 0 and it works great. I don't check the code related, is it the good practice? Why the initial timeout is 100ms?

NevenLeung commented 7 years ago

@elprup By using your question for reference, I change the timeout to 10ms and 5ms. It works fine, much quicker than 100ms. So far, it does not lead to any problem.