播放视频可以在iPhone4上使用,但不能在iPhone3G上使用
我正在使用MPMoviePlayerController播放电影:播放视频可以在iPhone4上使用,但不能在iPhone3G上使用,iphone,objective-c,cocoa-touch,mpmovieplayercontroller,Iphone,Objective C,Cocoa Touch,Mpmovieplayercontroller,我正在使用MPMoviePlayerController播放电影: STVideo *mySTVideo; mySTVideo = [items objectAtIndex:indexPath.row]; moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:mySTVideo.video_url]]; movie
STVideo *mySTVideo;
mySTVideo = [items objectAtIndex:indexPath.row];
moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:mySTVideo.video_url]];
moviePlayerViewController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"st-screen.png"]];
[self presentMoviePlayerViewControllerAnimated:moviePlayerViewController];
[moviePlayerViewController release];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
这在iPhone4上非常有效,但在iPhone3G上,它会显示视图,然后自动将其取消。为什么?我也有同样的问题,但还没有找到解决办法。有人在苹果论坛上发了一条关于这一点的帖子,我在那里发布了我的代码(与你的代码非常相似)
我还尝试使用UIWebView(加载自己的电影播放器)打开。结果与之前相同-它可以在iPhone 4和3GS上运行,但不能在3G上运行。请检查您的电影编码好吗?我认为3g不支持.mov和.mp4!