2016-03-08 83 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

它不工作 –