开发者

MPMusicPlayerController not play on background

开发者 https://www.devze.com 2023-03-30 00:24 出处:网络
i am using MPMusicPlayerController in开发者_JAVA百科 my app and when i enter to background it stop playing.

i am using MPMusicPlayerController in开发者_JAVA百科 my app and when i enter to background it stop playing.

this is how i add it :

musicPlayer = [MPMusicPlayerController iPodMusicPlayer];


The iPodMusicPlayer is always enabled in the background. You shouldn't have to set anything. And [MPMusicPlayerController applicationMusicPlayer] won't play in the background ever. I'd say you're using the wrong MPMusicPlayerController somewhere.


You need to indicate in your app's plist file that you want to play audio in the background.


you create the applicationMusicPlayer it is not play in back ground. you have to create ipodMusicPlayer to overcome this.

check this out for further refference. http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMusicPlayerController_ClassReference/Reference/Reference.html#//apple_ref/doc/uid/TP40008221

0

精彩评论

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