I want to play video in my iOS app. The video will be downloaded from Web.
Asked
Active
Viewed 822 times
-3
-
check out the tutorial.. http://mobile.tutsplus.com/tutorials/iphone/mediaplayer-framework_mpmovieplayercontroller_ios4/ http://stackoverflow.com/questions/7001716/need-a-tutorial-for-ios-to-play-video-files-in-my-application – Sudha Tiwari Feb 18 '13 at 06:48
1 Answers
0
This may be help you
#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
@interface ViewController : UIViewController
@property (nonatomic,strong)MPMoviePlayerController *moviePlayer;
@end
- (IBAction)playButtonEvent:(id)sender
{
NSURL *url=[[NSURL alloc]initWithString:@"http://www.jplayer.org/video/m4v/Big_Bunny_Trailer.M4v"];
_moviePlayer=[[MPMoviePlayerController alloc]initWithContentURL:url];
[_moviePlayer.view setFrame:CGRectMake(20, 100, 380, 150)];
[self.view addSubview:_moviePlayer.view];
_moviePlayer.fullscreen=YES;
_moviePlayer.allowsAirPlay=YES;
_moviePlayer.shouldAutoplay=YES;
_moviePlayer.controlStyle=MPMovieControlStyleEmbedded;
}

Rohan Pawar
- 1,875
- 22
- 40
-
This method is deprecated. check out http://stackoverflow.com/a/31277658/6042879 for updated way to play video from server URL – Lazar Kukolj Aug 27 '16 at 18:41