mpmovieplayercontroller をトリガーしてストリーミング オーディオを再生するボタンがあります。コントローラーが再生されているとき、すべてが期待どおりに機能し、灰色のクイックタイムの背景が表示されます。
ただし、プレーヤーを停止してもう一度ボタンを押すと、音声は聞こえますが、背景が黒くなります。また、mp3 を再生する前にビデオ ストリームに切り替えると、クイックタイムの背景が再び表示されます。
クイックタイムの背景が消えるのを止める方法を知っている人はいますか?
どんな助けでも大歓迎です。
-(IBAction) playmp3 {
NSString *medialink = @"http://someWebAddress.mp3";
self.player = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:medialink]] autorelease];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerDidFinish:) name:@"MPMoviePlayerPlaybackDidFinishNotification" object:self.player];
[self.player play];
}
- (void)moviePlayerDidFinish:(NSNotification *)obj {
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"MPMoviePlayerPlaybackDidFinishNotification" object:self.player];
self.player = nil;
}