I am going to build an iOS app that will download video from my web services to play offline in the application.
I am looking for a tutorial that will show me the basics which will include:
Play a videoAs you browse photos and videos in the Photos app, tap a video to play it on your iPhone. While it plays, you can do any of the following: Tap the player controls below the video to pause, unmute, favorite, share, delete, or see video information; tap the screen to hide the player controls.
Generally I use ASIHTTPRequest
to download things off the web, it is a great library that handles multithreading for you. It should give you a url. You can then play the video using the MPMoviePlayerController
class. The following is the code to play the video:
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
[[player view] setFrame:[self.view bounds]]; // Frame must match parent view
[self.view addSubview:[player view]];
[player play];
[player release];
To download the video from web, you can use ASIHTTP framework. There are plenty of examples which will give you a head start.
After that you can follow this tutorial, to playback the stored video - Video Playback from within an iOS 4 iPad Application
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With