【发布时间】:2014-09-23 09:35:51
【问题描述】:
我在服务器 url 中上传了视频,并将 URL 传递给 MPMoviePlayerController 以自动播放视频,但视频没有播放,我得到了黑页。当我使用本地视频时,它正在播放。
NSURL *fileURL = [NSURL URLWithString:@"server.net/projects/media/videos/023.mp4"];
NSLog(@"Magento url is %@", fileURL);
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[[moviePlayerController view] setFrame:CGRectMake(100,200, 600, 500)];
[moviePlayerController setShouldAutoplay:YES];
[moviePlayerController setControlStyle:MPMovieControlStyleEmbedded];
[[moviePlayerController backgroundView] setBackgroundColor:[UIColor clearColor]];
[moviePlayerController prepareToPlay];
[self.view addSubview:moviePlayerController.view];
【问题讨论】:
-
您的网址已损坏,无法指向视频文件
-
没有。视频正在浏览器中播放
-
如果是你当地的环境,那么好吧,对我不起作用
-
现在对你来说是否适用于 http://?
标签: ios objective-c mpmovieplayercontroller mpmoviewcontroller