如何显示“正在加载电影...”与 MPMoviePlayerController 的消息
我正在使用适用于 iOS 平台的 MPMoviePlayerController,但不确定为什么加载新视频时不会自动显示“完成”和“正在加载电影...”控件。
我最初的实现是使用 UIWebView 控件来流式传输视频,当访问视频时,将显示“完成”和“正在加载电影...”控件,直到视频加载并准备好播放。我想使用 MPMoviePlayerController 重现相同的用户体验。
我应该免费获得“完成”和“正在加载电影...”控制叠加吗?如果没有,我必须设置什么才能让它们在视频加载时显示?
NSURL *videoUrl = [NSURL URLWithString:urlString];
self.moviePlayer = [[[MPMoviePlayerController alloc] init] autorelease];
self.moviePlayer.movieControlMode = MPMovieControlModeDefault;
[self.moviePlayer setContentURL:videoUrl];
[self.moviePlayer prepareToPlay];
[self.view addSubview:self.moviePlayer.view];
[[self.moviePlayer view] setFrame: [self.view bounds]];
[self.moviePlayer setFullscreen:YES animated:YES];
I'm working with the MPMoviePlayerController for the iOS platform and am not sure why the "Done" and "Loading Movie..." controls are not displaying automatically when loading a new video.
My original implementation of this was to use the UIWebView control to stream the videos, and when the videos are accessed, the "Done" and "Loading Movie..." controls are displayed until the video is loaded and ready to play. I would like to reproduce the same user experience with the MPMoviePlayerController.
Should I get the "Done" and "Loading Movie..." control overlays for free? If not, what do I have to set to get them to show up while the video is loading?
NSURL *videoUrl = [NSURL URLWithString:urlString];
self.moviePlayer = [[[MPMoviePlayerController alloc] init] autorelease];
self.moviePlayer.movieControlMode = MPMovieControlModeDefault;
[self.moviePlayer setContentURL:videoUrl];
[self.moviePlayer prepareToPlay];
[self.view addSubview:self.moviePlayer.view];
[[self.moviePlayer view] setFrame: [self.view bounds]];
[self.moviePlayer setFullscreen:YES animated:YES];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您后续问题的答案,但无论如何......您可以通过以下方式加快速度:
This is answer to your follow-up question, but anyways... You can speed-up things a little bit with this: