我制作了一个应用程序,可让您收听流媒体广播。我不知道如何将 AirPlay 集成到我的应用程序中?
这是让它播放的代码:
-(IBAction)play {
if(clicked == 0) {
clicked = 1;
NSURL *url = [NSURL URLWithString:@"http://stream.domain.com/high.mp3"];
audioPlayer = [[AVPlayer alloc] initWithURL:url];
[audioPlayer play];
[start setTitle:@"Stop" forState:UIControlStateNormal];
}
else {
[audioPlayer pause];
clicked = 0;
[start setTitle:@"Start" forState:UIControlStateNormal];
}
}
我需要添加什么才能让 AirPlay 共享此内容?