我正在使用 MPMoviePlayerController 从 URL 流式传输音频。我将其设置为全屏模式以获得更好的控制视图
MPMoviePlayerController *audioStreamer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:URL]];
//[audioStreamer.view setFrame:CGRectMake(0,0,320,460)];
[audioStreamer.view setFrame:self.view.bounds];
//[self.view addSubview: audioStreamer.view];
[self.view insertSubview:audioStreamer.view belowSubview:HUD.view];
[audioStreamer setFullscreen:YES animated:YES];
//[audioStreamer.view addSubview:HUD.view];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(loadStateChanged:)
name: MPMoviePlayerLoadStateDidChangeNotification
object: audioStreamer];
[audioStreamer prepareToPlay];
在流式传输和准备播放时,我想显示 UIactivicty 指示器,以便用户考虑加载音频。需要在全屏模式下查看 MPMoviePlayerController 黑屏的活动指示器的任何建议或代码段。