ios - how to use AVQueuePlayer in AVPlayer -
currently using following codes play song
playeritem = [avplayeritem playeritemwithurl:[song valueforproperty:mpmediaitempropertyasseturl]]; [_avplayer replacecurrentitemwithplayeritem:playeritem];
here using avplayer playing audio files, requirement need play group (nsarray) of song continuously(currently player stop after playing 1 song).i heared avqueueplayer don't know how use avplayer if know please me
look @ following apple documentation: https://developer.apple.com/library/ios/documentation/avfoundation/reference/avqueueplayer_class/reference/reference.html
the basics of avqueueplayer not different avplayer. can initialize player list of avplayeritems, , continuous playback handled you.
avplayeritem *item1 = [avplayeritem playeritemwithurl:[nsurl urlwithstring:@"http://www.playeritemurl.com/item1.aac"]]; avplayeritem *item2 = [avplayeritem playeritemwithurl:[nsurl urlwithstring:@"http://www.playeritemurl.com/item2.aac"]]; avplayeritem *item3 = [avplayeritem playeritemwithurl:[nsurl urlwithstring:@"http://www.playeritemurl.com/item3.aac"]]; avqueueplayer *player = [[avqueueplayer alloc] initwithitems:@[item1, item2, item3]];
you can post more specific question, if have one, documentation should clear on how started.
Comments
Post a Comment