1
我使用此代碼嘗試播放視頻。然而,視頻從未播放,回調從來沒有說它已完成。我看不到任何我想念的東西或者它不應該在的地方。我檢查了路徑,這很好。視頻回放視圖確實出現。它只是沒有發揮在這一點上。MPMoviePlayerController不播放視頻
有什麼建議嗎?
NSURL *movieURL = [[NSBundle mainBundle] URLForResource:@"IntroMovie" withExtension:@"mov"];
NSLog(@"%@", movieURL);
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];
[moviePlayerController prepareToPlay];
[moviePlayerController.view setFrame:self.view.bounds];
[self.view addSubview:moviePlayerController.view];
[moviePlayerController play];
你使用ARC還是非ARC? –
我使用ARC並定位iOS 7 –
請參閱http://stackoverflow.com/questions/7493860/problem-playing-mov-file-in-mpmovieplayercontroller – karthika