我必须在 iPhone 中开发一个播放视频的播放器。我在视频编码和信号编码方面没有太多背景。当我测试一些 .mp4 和 .mov 文件时,我发现只能播放分辨率适合 iPhone 屏幕尺寸的视频,而无法播放更大尺寸的视频。在这种情况下,是否有任何解决方案可以在 iPhone 上播放所有电影大小。请给我一些指导。提前谢谢了。播放视频的代码如下:
NSURL *url = [NSURL URLWithString:@"http://192.65.123.108/test1.mov"];
//this movie has size of 480x272 can be played, other larger resolution cannot be played
_moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:url];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:_moviePlayer];
_moviePlayer.controlStyle = MPMovieControlStyleDefault;
_moviePlayer.shouldAutoplay = YES;
[self.view addSubview:_moviePlayer.view];
[_moviePlayer setFullscreen:YES animated:YES];