【问题标题】:MPMoviePlayerController in iPhoneiPhone 中的 MPMoviePlayerController
【发布时间】:2011-05-27 13:16:11
【问题描述】:

我在 iPhone 设备中遇到了MPMoviePlayerController 的问题。它在我的 iPhone 设备中播放,不清楚(无法正确查看视频内容)。但是它在我的模拟器中正常播放。

谁能告诉我解决这个问题的方法..

【问题讨论】:

  • 您应该尝试更好地解释这个问题。也许截图会有所帮助?

标签: iphone objective-c xcode mpmovieplayercontroller clarity


【解决方案1】:

使用此代码

NSString *filepath = [[NSBundle mainBundle] pathForResource:@"aaa" ofType:@"mp4"];  
NSURL *fileURL = [NSURL fileURLWithPath:filepath];  
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; 
[moviePlayerController.view setFrame:CGRectMake(0, 70, 320, 270)]; 
[self.view addSubview:moviePlayerController.view];  
moviePlayerController.fullscreen = YES;  
[moviePlayerController play];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-17
    • 2011-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多