How to download youtube video with youtube url in iphone programmatically [duplicate]

坚强是说给别人听的谎言 提交于 2020-01-11 07:14:11

问题


Possible Duplicate:
Save Youtube video to iPhone in the app

Is there any sdk or way to download youtube video with youtube url in iphone programmatically.

Please help me out for the same.

Thanks in advance.

Regards,


回答1:


If you are planning to release that app to AppStore I wouldn't advise you to leave that option. Youtube rules are not permitting that and Apple is following them very much these days although there are apps on AppStore that have that functionality enabled. One of my friends tried to add offline play to his Youtube player app and got rejected because of it.




回答2:


   1) Get the NSURL Object First using url string.   
   2) Allocate and start an NSURLConnection to fetch the file from the URL. Do not use sendSynchronousRequest:returningResponse:error      
   3) In the connection:didReceiveResponse: delegate method, create NSData object
   4) In the connection:didReceiveData: delegate method, get the data and append it to NSData object
   5) play the video using MPMoviePlayerController after getting data.


来源:https://stackoverflow.com/questions/14068538/how-to-download-youtube-video-with-youtube-url-in-iphone-programmatically

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