-3

I want to play video in my iOS app. The video will be downloaded from Web.

Vinner
  • 1,211
  • 1
  • 14
  • 15
  • 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 Answers1

1

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
  • 2,236
  • 20
  • 36
  • 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