0
iOS 앱을 개발 중이며 사용자가 버튼을 눌렀을 때 동영상을 재생하고 싶습니다. 이것을 개발했는데 사용자가 버튼을 누르면 비디오가 재생되지만 비디오가 끝나면 비디오의보기가 유지되고 비디오의 마지막 프레임에서 고정됩니다.iOS-Xcode : 비디오 복제가 마지막 프레임에서 고정되었습니다.
나는 구글에서 검색 한 나는이 질문을 발견 :
iOS 6, Xcode 4.5 video not exiting when done playing
나는 코드가 작성하지만 난 그것을 고정되지 않은 사용했다. 이 내 코드입니다 : 불편을 끼쳐 드려
-(IBAction)reproducirVideo:(id)sender
{
NSURL *url5 = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"instrucciones" ofType:@"mp4"]];
_moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:url5];
_moviePlayer.controlStyle = MPMovieControlStyleDefault;
_moviePlayer.shouldAutoplay = YES;
[self.view addSubview:_moviePlayer.view];
[_moviePlayer setFullscreen:YES animated:YES];
}
-(void) moviePlayBackDidFinish:(NSNotification *)aNotification{
[_moviePlayer.view removeFromSuperview];
_moviePlayer = nil;
}
- (void)moviePlayerWillExitFullscreen:(NSNotification*) aNotification {
[_moviePlayer stop];
[_moviePlayer.view removeFromSuperview];
_moviePlayer = nil;
}