我在服务器 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];