Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need a tutorial for iOS to play video files in my application [closed]

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:

  1. Downloading the video file from the web
  2. Storing it in a data store for my application (what structure / location)
  3. Playing this video from my data store
  4. What video format I require
like image 890
Jason Avatar asked Aug 09 '11 19:08

Jason


People also ask

How do I play videos on iOS?

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.


2 Answers

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];
like image 160
Sertorio Noronha Avatar answered Oct 09 '22 01:10

Sertorio Noronha


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

like image 25
Srikar Appalaraju Avatar answered Oct 09 '22 01:10

Srikar Appalaraju