perminder-klair / angular-soundmanager2

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

start page with music loaded #28

Open liniquer opened 9 years ago

liniquer commented 9 years ago

i have a player and i need the set a music from page load.

and when the User click play he already play this music that I set , and if he chooses another song change

mroker242 commented 8 years ago

I am trying to find out how to do this as well. Any suggestions? How can music be automatically played?

enesyurtlu commented 7 years ago

I made "playlist starting on page load". You can use like this: PS: If yu don't want to play the playlist automatically remove "angularPlayer.play();".

`$scope.homesongs = [{"id":"48","title":"Gülşen - Bir Fırt Çek (Catwork Club Versiyon)","url":"http://www.mixboxx.com/depos/electro-house/gulsen/201702/gulsen-bir-firt-cek-catwork-club-versiyon.mp3","art":"http://www.mixboxx.com/uploads/parca/201702/ctwrk-18022017-001953.jpg","artist":"Gülşen","dj":"Catwork Remix Engineers","durationt":"4:10"},{"id":"3","title":"Desiigner - Panda (Kiko Franco & Kubski Remix)","url":"http://www.mixboxx.com/depos/brazilian-bass/desiigner/201702/desiigner-panda-kiko-franco-kubski-remix.mp3","art":"http://www.mixboxx.com/uploads/parca/201702/panda-05022017-014045.jpg","artist":"Desiigner","dj":"Kiko Franco & Kubski","durationt":"4:35"},{"id":"15","title":"KVSH - Potter (Original Mix)","url":"http://www.mixboxx.com/depos/brazilian-bass/www-mixboxx-com/201702/kvsh-potter-original-mix.mp3","art":"http://www.mixboxx.com/uploads/parca/201702/potter-06022017-160453.jpg","artist":"www.mixboxx.com","dj":"KVSH","durationt":"5:37"}];

angular.forEach($scope.homesongs, function (value) { angularPlayer.addTrack(value); }); angularPlayer.play();`