开发者

how to playing audio in background mode when If i click on iphone button to "minimize" the app?

开发者 https://www.devze.com 2023-03-22 07:53 出处:网络
I\'m work on new iphone au开发者_如何转开发dio application. When i open the app, the Audio was loaded and started. If i click on iphone button to \"minimize\" the app, the sound was stopped. I need t

I'm work on new iphone au开发者_如何转开发dio application.

When i open the app, the Audio was loaded and started. If i click on iphone button to "minimize" the app, the sound was stopped. I need the sound still playing in background mode.

How i do this?

Thank you


To play in the background, add an Array entry named "UIBackgroundModes" your .plist file, and add "audio" as array member.

.plist entry:

UIBackgroundModes Array
Item0 String audio


Try to look at AVAudioSession also.

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

That should help.

0

精彩评论

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