Search iOS MediaPlayer

I can use iOS MediaPlayer and play the movie this way. But I need to watch a movie. How can I do this, I play the movie using MediaPlayer:

    NSURL *videoURL = [NSURL fileURLWithPath:self.filename];

    MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];

    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(moviePlayBackDidFinish:) 
                                                 name:MPMoviePlayerPlaybackDidFinishNotification 
                                               object:moviePlayer];

    moviePlayer.controlStyle = MPMovieControlStyleNone; 
    moviePlayer.shouldAutoplay = YES; 
    [self.view addSubview:moviePlayer.view]; 
    [moviePlayer setFullscreen:YES animated:YES]; 

Thanks in advance.

+5
source share
1 answer

Sorry for your own answer,

NSURL *videoURL = [NSURL fileURLWithPath:self.filename];

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];

[[NSNotificationCenter defaultCenter] addObserver:self 
                                         selector:@selector(moviePlayBackDidFinish:) 
                                             name:MPMoviePlayerPlaybackDidFinishNotification 
                                           object:moviePlayer];

moviePlayer.controlStyle = MPMovieControlStyleNone; 
moviePlayer.shouldAutoplay = YES; 
moviePlayer.initialPlaybackTime = 5;
[self.view addSubview:moviePlayer.view]; 
[moviePlayer setFullscreen:YES animated:YES]; 

it worked for me to find time in the movie ...

0
source

All Articles