Play facebook videos in ios application

雨燕双飞 提交于 2019-12-10 16:04:33

问题


I want to embed Facebook videos in my app. I am getting video links from a webservice. For example:

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

Is it possible to embed this video in native iOS app using Objective-C?

Thanks in advance


回答1:


Try this one:

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];


来源:https://stackoverflow.com/questions/35863694/play-facebook-videos-in-ios-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!