2013-02-18 3 views
-3

iOS 앱에서 동영상을 재생하고 싶습니다. 비디오가 웹에서 다운로드됩니다.iOS 앱에서 웹에서 비디오를 재생하는 방법은 무엇입니까?

+0

체크 아웃 튜토리얼 도움이 될 수 있습니다 .. http://mobile.tutsplus.com/tutorials/iphone/mediaplayer-framework_mpmovieplayercontroller_ios4/ http://stackoverflow.com/questions/7001716/ios-to-play-video-files-in-my-application의 튜토리얼이 필요하지 않습니다. –

답변

0

이것은 당신이

#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; 
} 
+0

이 메소드는 추천되지 않습니다. 서버 URL에서 비디오를 재생하는 업데이트 된 방법은 http://stackoverflow.com/a/31277658/6042879를 확인하십시오. –

관련 문제