MPMoviePlayerController multitasking problem

删除回忆录丶 提交于 2019-11-30 22:29:07

You should read the Technical Q&A QA1668: How to play audio in the background with MPMoviePlayerController.

Summary of the steps needed:

  • declare that your application supports background execution for audio
  • assign an appropriate category to your audio session (default category is not ok)

I got it working by putting following two lines in Delegate file:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive: YES error: nil];

may be you forget to add this in

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
     {
    [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
   }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!