kxmovie
kxmovie copied to clipboard
How to play the next one in theKxMoviesPlayerViewController ?
I added a method, but the next one was glview only when the sound had no images!
-(void)nextVideo{ if (_currentIndex <_mvArray.count-1) { _currentIndex = _currentIndex+1; [self playNewContentIndex:_currentIndex]; } } -(void)playNewContentIndex:(NSUInteger)index{ if (_activityIndicatorView.isAnimating) { [_activityIndicatorView stopAnimating]; } [_activityIndicatorView startAnimating]; __weak MoviesPlayerViewController *weakSelf = self; if (self.playing) { [self pause]; [self freeBufferedFrames]; } if (_glView) { [_glView removeFromSuperview]; } self.artworkFrame = nil; _moviePosition = 0; NSError *error = nil; [_decoder openFile:_mvArray[index] error:&error]; dispatch_async(dispatch_get_global_queue(0, 0), ^{ NSError *error = nil; __strong MoviesPlayerViewController *strongSelf = weakSelf; @synchronized(_decoder){ [_decoder openFile:_mvArray[index] error:&error]; [strongSelf setupPresentView:_decoder]; } if (strongSelf) { dispatch_sync(dispatch_get_main_queue(), ^{ [_activityIndicatorView stopAnimating]; [strongSelf setMovieDecoder:_decoder withError:error]; [strongSelf play]; }); } }); }
Already solved
Hi, how to solve this ? I have the problem too...
Hi, how to solve this ?
okay,Already solved @wangzhili1988
- (void)playNextVideo:(NSString *)filePath { [self pause]; [self freeBufferedFrames]; [_decoder closeFile]; _moviePosition = 0; [_decoder openFile:filePath error:nil]; [self play]; }