如何在iOS中下载YouTube视频 [英] How do I download a youtube video in iOS

查看:1186
本文介绍了如何在iOS中下载YouTube视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在iOS网页视图中推出YouTube视频,但如何下载该视频以保存在iPad应用上?可能吗?我需要使用一些NSURLConnection对象的调用,然后将接收的数据保存到正确的文件格式?



我不确定的一个特定的点是什么url请求文件将被。当您在YouTube上观看视频时,可以下载的视频被触发一个按钮,所以对我来说这不是很明显的URL。

解决方案

您需要下载iOS兼容版本的视频,可能使用与 Safari FlashToHTML5插件



Youtube提供视频下载链接:



a href =http://lifehacker.com/#!5152236/youtube-offers-official-downloads-and-purchases-for-videos =nofollow> http://lifehacker.com/#!5152236/ youtube-offers-official-downloads-and-purchases-for-videos



..确保你不违反他们的TOS。

$一般来说,下载大文件时,您可以考虑实现可恢复文件下载,espe因为移动设备上的连接是短暂的。



此外,请确保您在下载(或恢复下载)时使用WiFi网络,使用可达性。请注意,超过蜂窝网络的带宽过多是应用程序拒绝的原因。


I know how to launch a youtube video within an iOS web view, but how can I download that video to save on my iPad app? Is it possible? Do I need to use some call with a NSURLConnection object and then save the received data into the proper file format?

One specific point I am unsure about is what the url to request the file would be. When viewing a video on youtube, the downloadable videos are triggered with a button, so it's not evident to me what the url would be.

解决方案

You would need to download an iOS-compatible version of the video, possibly using the same technique employed by the Safari FlashToHTML5 plugin.

Youtube DOES offer video download links:

http://lifehacker.com/#!5152236/youtube-offers-official-downloads-and-purchases-for-videos

.. make sure you do not violate their TOS.

In general, when downloading large files, you might consider implementing resumable file downloads, especially because connectivity on a mobile device is transient.

On top of that, make sure that you're on a wifi network when downloading (or resuming a download), using Reachability. Note that excessive bandwidth usage over cellular networks is a reason for app rejection.

这篇关于如何在iOS中下载YouTube视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆