1
응용 프로그램이 시작되는 동안 비디오를로드하는 응용 프로그램을 개발 중입니다. 비디오가 재생되고 화면에서 제거되는 동안 거대한 얼간이를 관찰합니다.Objective C에서 비디오를 재생하는 방법 -로드 할 때 Jerk가 발생합니다.
내 코드는 다음과 같다 :
VideoPlayer.m
-(id)initWithVideo: (CGRect)frame file:(NSString *)videoFile { if (self = [super initWithFrame:frame]) { NSArray *file = [videoFile componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"."]]; NSString *moviePath = [[NSBundle mainBundle] pathForResource:[file objectAtIndex:0] ofType:[file objectAtIndex:1]]; if (nil != moviePath) { if (nil != theMovie) { [theMovie.view removeFromSuperview]; } theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]]; theMovie.view.frame = self.bounds; theMovie.moviePlayer.scalingMode = MPMovieScalingModeAspectFit; theMovie.moviePlayer.controlStyle = MPMovieControlStyleNone; theMovie.moviePlayer.movieSourceType = MPMovieSourceTypeFile; theMovie.moviePlayer.fullscreen = NO; [self addSubview:theMovie.view]; } } return self; }
내가 그것을 놓치고 곳에 나를 인도 해주십시오.
많은 감사 카일. 오늘이를 구현하고 u를 업데이트 할 예정입니다. – TechBee
감사합니다 카일. 잘됐다. 와우. – TechBee
위대한, 당신은 그 대답을 받아 들여야합니다. – Kyle