如何在iphone中使用网址播放Facebook视频?

时间:2015-05-20 00:33:26

标签: ios facebook

我得到" json"来自facebook api的回复,我想播放用户分享的视频。

我正在使用此代码:

NSString *path =[[FacebookFeedarray objectAtIndex:(long)clicked.tag] objectForKey:@"source"];

NSURL *url = [NSURL fileURLWithPath:path];

moviePlayer =  [[MPMoviePlayerController alloc]initWithContentURL:url];
moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
moviePlayer.shouldAutoplay = YES; 
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
[moviePlayer play];

网址是: https://video.xx.fbcdn.net/hvideo-xta1/v/t42.1790-2/11324750_10153450000004560_1780301857_n.mp4?efg=eyJybHIiOjMwMiwicmxhIjo1MTJ9&rl=302&vabr=168&oh=9c64b9ae34e1c1751d41ef2a4c4c220f&oe=555E0678

1 个答案:

答案 0 :(得分:0)

也添加此代码。

[moviePlayer setMovieSourceType:MPMovieSourceTypeStreaming];

希望有所帮助:)