开发者

how to run audio after the application hes entered in backgroundMode in iPhone 4.0

I have tried several forums but still unable to get the answer.. I am developing an application which does radio streaming in iPhone 4.0

Now i want that the audio of the radio must continue even after the application is in suspended state..

Also i have an .m3u file which contains 3 urls of .mp3 So i also want that if one mp3 file finishes in suspending state it must co开发者_StackOverflow社区ntinue with another. I have done the code when application is in foreground but confused how to do this when application is in background state..

Please help


This is wht i have used and worked for me..

UIBackgroundTaskIdentifier backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
            /* just fail if this happens. */
            NSLog(@"BackgroundTask Expiration Handler is called");
            [[UIApplication sharedApplication] endBackgroundTask:backgroundTask];
        }];

hAPPY cODING...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜