iPhone SDK Tutorial: Play Video/Movie in App

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
12,325
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 17, 2009

Hey guys, in this tutorial I am going to show you how to play a video or movie inside of the app with a touch of a button.

Please Comment, Rate, and Subscribe!

Follow Me on Twitter: http://twitter.com/rybread7293

Need an invite to Lockerz?? Go here: http://lockerzinvitesme.tk

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (rybread421)

  • can you do a quick vid on how to put the picture next of the app

  • @sports24man im not sure as to what you mean by this....do you mean an icon? or what?

see all

All Comments (29)

Sign In or Sign Up now to post a comment!
  • @jamescmartinez

    I'm sorry but what do you mean by remove the breakpoint?

  • @xenonaxel007 Remove the breakpoint. 

  • stopped at breakpoint 1 NSBundle *bundle = [NSBundle mainBundle]; what do i do

  • @sports24man easy, first drag a picture into your project, then go to your .plist and type the name of your picture next to "icon file".

  • @fdardari

    That works with iOS 4.3 although when copying and pasting out of your post--looks like a hidden character carried over on line starting with NSURL. Typed it in fresh, worked.

  • @ifraz22 The same occurred when I tried it in Xcode 4. Does anyone know why?

  • i'm trying this on xcode version 4.. i can hear the sound of the video only.... do u know why its not working properly?

  • Great Videos! Could you do a video on playing multiple videos for xcode 3.2? I've tried to resolve all the warnings etc. No dice. I've done single video for x3.2  with NSString *path and using the MPMoviePlayerViewController but when I try to duplicate the code for a second video, it goes down in flames. Again, thanks for the great videos.

  • @fdardari Check your source, there's a few control characters that slipped in:

    "moviePath = [bundle" => Zero-width breaking space

    "moviePlayer.scalingMo" => Soft Hyphen

    "presentMoviePlayerViewControl­l" => Soft Hyphen

    They're not technically "control characters", so they didn't show up in XCode when I toggled "Show Control Characters". Took me a while to pick them out. Just highlighting this in case anybody else has gotten a compile error of "Stray \357 in program" like I did.

  • Try this: NSBundle *bundle = [NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"rimini" ofType:@"m4v"]; NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain]; MPMoviePlayerViewController *theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL]; theMovie.moviePlayer.scalingMo­de = MPMovieScalingModeAspectFill; [self presentMoviePlayerViewControll­erAnimated: theMovie]; [theMovie.moviePlayer play];

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more