我做了一個應用程序,它可以讓你收聽流媒體廣播。 我不知道如何將AirPlay集成到我的應用程序中?如何將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的共享呢?
感謝它的工作原理:-) – 2012-07-30 17:59:57