【问题标题】:Play Videos in MPMoviePlayerController from a URL?从 URL 播放 MPMoviePlayerController 中的视频?
【发布时间】:2010-10-04 08:25:31
【问题描述】:

我正在尝试在 MPMovieplayer 的帮助下播放来自 Url 的视频,MPMovieplayer 将其加载到 Quicktime 播放器中,而我希望视频仅在我的应用程序中播放(无背景模式)?我怎样才能做到这一点?将在 UIWebview 而不是 MPMoviePlayer 中播放视频吗? 此外,当 QuickTime Player 仅加载音频播放而没有显示视频时?我正在使用以下代码

NSString *videoFilepath = @"http://www.migital.com/Hemant/1.3gp";

NSURL *videoURL = [NSURL URLWithString:videoFilepath ];

MPMoviePlayerViewController *movie = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(playbackFinishedCallback:)
                                             name:MPMoviePlayerPlaybackDidFinishNotification
                                           object:movie];

[self presentMoviePlayerViewControllerAnimated:movie];

【问题讨论】:

    标签: iphone ios4


    【解决方案1】:

    您必须将movie.view 添加到您的视图中

    【讨论】:

      【解决方案2】:

      web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

      NSString *urlAddress = @"HTTP://";
      
      
      NSURL *url = [NSURL URLWithString:urlAddress];
      
      
      NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
      [web loadRequest:requestObj];
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-04-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-11-29
        • 2013-10-10
        • 2012-05-11
        • 1970-01-01
        相关资源
        最近更新 更多