Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

MPMoviePlayer Tutorial?

KenrikKenrik Posts: 288Registered Users
edited December 2008 in iOS SDK Development
I'm trying to play a single 30 second m4 movie (only once) I'm finding the MoviePlayer sample to be a bit confusing. Is there any tutorial on playing a simple movie?

I just need a small block of code that will allow me to play a movie when I need to.
Post edited by Kenrik on
· ·

Replies

  • BuckyBucky Posts: 356Registered Users
    edited November 2008
    I've actually got a video tutorial that still needs to be uploaded

    I'll upload to vimeo when I get home/over the weekend
    · ·
  • KenrikKenrik Posts: 288Registered Users
    edited November 2008
    That sounds great! I can't wait!

    Thanks!
    · ·
  • KenrikKenrik Posts: 288Registered Users
    edited December 2008
    Were you able to upload it? if so where can I find it? :)
    · ·
  • johnny2cujohnny2cu Posts: 4New Users
    edited December 2008
    If you can still upload the video tutorial it would help a lot.
    Thanks
    · ·
  • BuckyBucky Posts: 356Registered Users
    edited December 2008
    Sorry it's not up already. I couldn't find the video file, as I probably deleted it by accident :(

    I still have the XCode project files, however, so I'll re-record this evening, and chuck up the project files for good measure :)
    · ·
  • johnny2cujohnny2cu Posts: 4New Users
    edited December 2008
    Thanks a bunch, I can't wait.
    · ·
  • KenrikKenrik Posts: 288Registered Users
    edited December 2008
    :).... :o
    · ·
  • KenrikKenrik Posts: 288Registered Users
    edited December 2008
    ????? :) please...
    · ·
  • elpuercoelpuerco Posts: 136Tutorial Authors
    edited December 2008
    I just got this to work for me, albeit not exactly what I want it does play the movie clip!
    -(void) playMovieAtURL
    {
    	NSString *path = [[NSBundle mainBundle] pathForResource: @"enter name of your movie here" ofType: @"enter extension type here"];
    	
        MPMoviePlayerController	*theMovie = [[MPMoviePlayerController alloc] initWithContentURL: [NSURL fileURLWithPath: path]]; 
        
    	theMovie.scalingMode = MPMovieScalingModeAspectFill; 
        
    	theMovie.movieControlMode = MPMovieControlModeDefault;
    	
        // Register for the playback finished notification. 
    	
        [[NSNotificationCenter defaultCenter] addObserver:self 
    											 selector:@selector(myMovieFinishedCallback:) 
    												 name:MPMoviePlayerPlaybackDidFinishNotification 
    											   object:theMovie]; 
    	
        // Movie playback is asynchronous, so this method returns immediately. 
        
    	[theMovie play]; 
    } 
    
    // When the movie is done,release the controller. 
    -(void)myMovieFinishedCallback:(NSNotification*)aNotification 
    {
        MPMoviePlayerController* theMovie=[aNotification object]; 
        [[NSNotificationCenter defaultCenter] removeObserver:self 
                                                        name:MPMoviePlayerPlaybackDidFinishNotification 
                                                      object:theMovie]; 
    	
        // Release the movie instance created in playMovieAtURL
        [theMovie release]; 
    }
    
    
    · ·
Sign In or Register to comment.