当我从 OS 3.x 迁移到 4 时,视频仅播放声音
嗯..基本上就是这样,当我播放游戏中的电影时,只有声音播放,视频不播放,显示黑屏,甚至触摸也被禁用。
这是代码的相关部分:
myMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:[self movieURL]];
myMovie.moviePlayer.scalingMode = MPMovieScalingModeFill; myMovie.moviePlayer.controlStyle = MPMovieControlModeHidden;
[myMovie.moviePlayer 播放];
谢谢。
编辑:好的,我现在开始工作了,我需要添加这行代码:
[self presentMoviePlayerViewControllerAnimated:myMovie];
现在的问题是,我不想看到媒体播放器控件(暂停、停止等),我只想全屏观看视频,仅此而已,有什么想法吗?
Well.. basically that's what happens, when I play a movie from a game I have, only the sound plays, the video doesn't, showing a black screen, even the touch is disabled.
This is the relevant part of the code:
myMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:[self movieURL]];
myMovie.moviePlayer.scalingMode = MPMovieScalingModeFill;
myMovie.moviePlayer.controlStyle = MPMovieControlModeHidden;
[myMovie.moviePlayer play];
Thx.
Edit.: Ok, I got it working now, I needed to add this line of code:
[self presentMoviePlayerViewControllerAnimated:myMovie];
The problem now is, that I dont want to see the mediaplayer controls (pause, stop, etc), I just want to watch the video fullscreen, that's all, any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说,它添加了 MPMoviePlayerController 文档中的这两行代码,而MoviePlayer 示例代码应用程序中没有这些代码行。因此,在 4.1 和 4.2 中的示例应用程序中播放流时,我只获得音频。
For me, it was adding these two lines from the MPMoviePlayerController documentation that are not in the MoviePlayer sample code app. So I was getting just audio when playing a stream in the sample app in both 4.1 and 4.2.