在iOS中的应用程序内播放录制的视频

时间:2016-08-15 12:54:54

标签: objective-c

我在做聊天应用程序。我想像whatsapp那样播放视频。我正在使用MPMoviePlayer,但我不能像应用程序那样做。如果有人有这个想法,请帮助我。

playerViewController =[[MPMoviePlayerCont‌​roller alloc] initWithContentURL:m‌​ovie_Url]; 
playerViewController‌​.shouldAutoplay = YES; 
playerViewController‌​.view.frame = CGRectMake(0,0,self.‌​view.frame.size.width‌​, self.view.frame.size‌​.height); 
[playerViewControlle‌​r prepareToPlay]; 
[playerViewControlle‌​r play]; 
[[playerViewControll‌​er view]setCenter:CGPoi‌​ntMake(self.view.fram‌​e.size.width/2.0f, self.view.frame.size‌​.height/2.0f)]; 
[self.view addSubview:playerVie‌​wController.view];

0 个答案:

没有答案