embed video in a view controller ios

孤人 提交于 2019-12-13 02:54:44

问题


I have a json file which includes data and between this data I have a video field.

how can I embed a video object in a view controller, what shall I put in the interface builder?? I cannot find video object in the objects existed on the right side. see below:

Shall I add some libraries? I need to help me how can I play a video object on my application.

I need your help please.


回答1:


Just load the files into UIWebView, it can handle both videos and PDFs.

OR

https://developer.apple.com/library/ios/#qa/qa2010/qa1240.html




回答2:


There is really good class for it VideoPlayerKit. Using VideoPlayerKit is easy to use. All controls, progress bar, and airplay are already set up.

This is example's screen



来源:https://stackoverflow.com/questions/16482328/embed-video-in-a-view-controller-ios

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