Quantcast
Viewing all articles
Browse latest Browse all 8068

systemMusicPlayer and setQueue only adds 1 song

Hi, I'm making a music app and so far, it's functional except for one thing...when I select an album, and add all the songs to the queue using setQueue()...it only adds the first song. When I go to skip to the next song, it just replays the first song. Here is my code...

var musicPlayer = Ti.Media.systemMusicPlayer;
var rowItem = e.source.item;
var albumQuery = {};
 
albumQuery['mediaType'] = {value:Titanium.Media.MUSIC_MEDIA_TYPE_MUSIC};
albumQuery['grouping'] = {value:Titanium.Media.MUSIC_MEDIA_GROUP_ALBUM};
albumQuery['albumTitle'] = {value:'Comatose', exact:true};
albumQuery['albumArtist'] = {value:'Skillet', exact:true};
var albumData = Ti.Media.queryMusicLibrary(albumQuery);
 
var albumList = [];
for(var i = 0;i < albumData.length;i++) {
    albumList.push(albumData[i].title);
};
 
alert(albumList);
musicPlayer.setQueue(albumData);
musicPlayer.play();
So what do I do to fix this problem?

FYI: The alert and the extra array I don't need (albumList) was there to see what was wrong.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>