开发者

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

开发者 https://www.devze.com 2023-01-05 17:52 出处:网络
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

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

精彩评论

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

关注公众号