2016-03-08 58 views
4

我想在我的应用程序中嵌入Facebook视频。我从web服务获取视频链接。 例如:在ios应用程序中播放Facebook视频

"video_url": "https://www.facebook.com/urdutimes.ca/videos/520665921438799/" 

是否有可能使用Objective-C嵌入该视频在原生iOS应用?

在此先感谢

+0

是的,这是可能的。 – Hima

+0

您可以使用'MPMoviePlayerController' –

+0

您可以告诉我如何,因为我已经读了其他地方,MPMoviePlayerController需要直接链接到视频像http://www.example.com/test.mp4 –

回答

0

试试这个:

NSURL *url = [NSURL URLWithString:@"https://www.facebook.com/urdutimes.ca/videos/520665921438799/"]; 
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; 
mp.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming; 
[self presentMoviePlayerViewControllerAnimated:mp]; 
+0

它不工作 –

相关问题