开发者

store multiple song in mpplayer that are being fetch from database having song persistent id

开发者 https://www.devze.com 2023-02-28 19:48 出处:网络
i am trying to store multiple song in mpplayer that are being fetch from database having song persistent id..but only single song is being added .here is what i am doing

i am trying to store multiple song in mpplayer that are being fetch from database having song persistent id..but only single song is being added .here is what i am doing

MPMediaQuery *query = [MPMediaQuery songsQuery开发者_JAVA百科]; MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue:persistentId forProperty:MPMediaItemPropertyPersistentID]; [query addFilterPredicate:predicate]; NSArray *mediaItems = [query items]; //this array will consist of song with given persistentId. add it to collection and play it MPMediaItemCollection *col = [[MPMediaItemCollection alloc] initWithItems:mediaItems]; ///.... [col release];

thanks in advance

Regards devon smith


Are you sure that the PersistentID represents more that 1 track? I use a Persistent ID for each separate track in the album.

0

精彩评论

暂无评论...
验证码 换一张
取 消