开发者

How can you make you app close, but get Safari to play a radio stream

开发者 https://www.devze.com 2023-02-08 10:24 出处:网络
I\'ve seen a radio app, from a local radio station that has the option to play the stream in the background. So you press 开发者_高级运维the button in the app, the app closes and then Safari opens and

I've seen a radio app, from a local radio station that has the option to play the stream in the background. So you press 开发者_高级运维the button in the app, the app closes and then Safari opens and plays the stream through Quicktime.

How is this done? I think it is a really nice feature. Was under the impression that your app cant interact with the phone in this way. Like its 'sandboxed'.

Thanks -Code


NSString *pth = @"http://www.example.com/stream.mp3";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:pth]];

Although this is not needed anymore as iOS 4 supports multitasking for all apps. Previous iOSes only supported multitasking for Safari, iPod and Mail (and Phone? dunno).

0

精彩评论

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