我有一個iOS的7前工作一碼,經過更新的電影不是在玩:MPMoviePlayerViewController不工作在iOS 7
-(void)setMovie:(NSURL *)newMovie autoPlay:(BOOL)autoPlay
{
movieView_ = [[MPMoviePlayerViewController alloc] initWithContentURL:newMovie];
[movieView_.view setContentMode:UIViewContentModeScaleAspectFit];
[movieView_.moviePlayer setShouldAutoplay:NO];
movieView_.moviePlayer.view.frame=self.view.frame;
[movieView_.moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[movieView_.moviePlayer setMovieSourceType:MPMovieSourceTypeFile ];
[movieView_.moviePlayer prepareToPlay];
id currentPhotoView = [photoViews_ objectAtIndex:currentIndex_];
[currentPhotoView addSubview:movieView_.moviePlayer.view];
[movieView_.moviePlayer play];
}
不知道是什麼問題,並且應用程序不崩潰。
你想從YouTube或其他來源播放視頻,請在這裏顯示任何鏈接,這樣我就可以嘗試給你正確的建議。 – Pratik
感謝Pratik,我從文檔目錄播放電影,並且我在scrollView控制器中顯示了movieView。 – ANeme
url值:file://localhost/var/mobile/Applications/C4FF3792-E70E-4540-8C03-0B86830E05A5/Documents/Main%20Album/images/picture-10112013-00000.MOV – ANeme