【问题标题】:MPMoviePlayerViewController Issue-IphoneMPMoviePlayerViewController 问题-Iphone
【发布时间】:2011-06-27 04:59:37
【问题描述】:

我想为此实现电影播放器​​,我正在使用 MPMoviePlayerViewController。

我的代码是,

moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL]; 

moviePlayerController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming; 
[self presentModalViewController:moviePlayerController animated:YES]; 
[[moviePlayerController moviePlayer] play];

但它一直在加载而不是播放视频。我的代码有什么问题。

我的要求是,

在电影播放器​​中,当我点击完成按钮时,它会转到我开始的页面。

感谢您的考虑和努力

编辑:

任何使用 MPMoviePlayerController 而不是使用 MPMoviePlayerViewController 的示例代码请给我。(请给我你实现的示例代码,因为我看不懂教程代码)请帮助我

【问题讨论】:

    标签: iphone ios mpmovieplayercontroller


    【解决方案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
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-06
      相关资源
      最近更新 更多