is it possible to play an instance of AVPLayer (with a video) and in the same time use an instance of a MPMusicPlayerController to play an iTunes playlist?
I've tried several solution but every time I play the video the audio stops and every time I play the audio the video stops.
I play the AVPlayer with this code
AVPlayerItem *new = [AVPlayerItem playerItemWithAsset:videoAsset];
self.playerItem = new;
[player replaceCurrentItemWithPlayerItem:self.playerItem];
[self.playerItem seekToTime:kCMTimeZero];
[player play];
and the MPMusicPlayer with:
MPMediaItemCollection *items = (MPMediaItemCollection*) aNotification.object;
MPMusicPlayerController *p = [[MPMusicPlayerController alloc] init];
[p setQueueWithItemCollection:items];
[p play];
作为解决方案,我使用了两个AVPLayer,一个用于音乐,另一个用于视频
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.