我正试图在MPMovieplayer的帮助下播放来自网址的视频,并将其加载到Quicktime播放器中,而我希望视频仅在我的应用程序中播放(无背景模式)?我怎么能实现那个?将在UIWebview中播放视频而不是MPMoviePlayer工作? 此外,当QuickTime播放器仅加载音频播放时,没有显示视频?我使用以下代码
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];
答案 0 :(得分:5)
您必须在视图中添加movie.view
答案 1 :(得分:-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];