Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to preload my movie before playing it ( MPMoviePlayerController )
    primarykey
    data
    text
    <p>i would like to preload my MPMoviePlayerController, the problem is that MPMoviePlayerController is taking too much time to get ready so the loading icon is displaying then the video is displayed, if i play another video after it is played directly but not the first time... :(</p> <p>i know there is this : MPMoviePlayerLoadStateDidChangeNotification But i don't know how it works actually.</p> <p>This is my code :</p> <pre><code>- (void) startSlideShow:(NSString *)nameFile { NSURL *url = [NSURL fileURLWithPath:nameFile]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer]; moviePlayer.view.frame = CGRectMake(0, 0, 768, 1024); moviePlayer.controlStyle = MPMovieControlStyleDefault; [self.view addSubview:moviePlayer.view]; CATransition *animation = [CATransition animation]; [animation setDuration:0.5]; [animation setType:kCATransitionFade]; [animation setSubtype:kCATransitionFromLeft]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [[self.view layer] addAnimation:animation forKey:@"SwitchToView1"]; [moviePlayer setFullscreen:YES animated:YES]; } -(void)moviePlayBackDidFinish: (NSNotification*)notification { MPMoviePlayerController *moviePlayer = [notification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer]; if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) { [moviePlayer.view removeFromSuperview]; } [self checkResources]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload