iPhone : Simple Radio App

2019-08-29 02:44发布

问题:

i am made a simple radio app which call out safari to stream audio/radio. My problem is that i don't konw how to get back control and show other content while safari is playing music. Of course i do not want the user to have to get out of the app and re-enter. I am thinking a tabbed app but i need your help to regain control.

NSURL *url = [NSURL URLWithString:@"http://www.piratefm.gr/128.m3u"];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[webView loadRequest:req];
[super viewDidLoad];

回答1:

Use an AVAudioPlayer and init it with the URL