Adobe Air:如何限制下载速度?
使用 URLStream 下载文件时,Adobe AIR 是否可以控制 AIR 的带宽使用情况?
Is there any possibility in Adobe AIR to control bandwidth usage with AIR when downloading a file using URLStream?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简短的回答,你不能。 Air 的目的并不是“限制”任何类型的下载(我不明白为什么你一开始会这么做……),因为如果你通过 HTTP 进行下载,它实际上会使用操作系统的默认浏览器。
限制它的唯一方法是创建一个 Socket 并尝试在其中实现 HTTP 协议或实现您自己的协议。坦白说,我什至都不会尝试。我认为限制下载带宽没有多大用处......
Short answer, you can't. It is not Air's purpose to 'limit' any kind of downloads (and I don't get why you would in the first place...) since if you're going over HTTP it actually uses the OS' default browser.
The only way you could limit it is by create a Socket and try to implement an HTTP protocol within that or implement your own protocol. Frankly, I wouldn't even try. I don't see much use for limiting bandwidth for download...
你可以尝试检查 NetLimiter 是否可以处理这个问题。这是链接
http://www.netlimiter.com/
希望这会有所帮助。
you can try and check if NetLimiter can handle this. Here is the link
http://www.netlimiter.com/
Hope this helps.
“吃掉所有可用流量”对客户端来说是一件好事。
如果流下载速度变慢,则播放时间用户将不得不等待缓冲,这将是糟糕的。
您最好的选择是检测 DL 的速度,如果它低于 XXX,则让它下载较低分辨率的视频。为此,您需要在服务器上拥有该文件的几个版本。这允许客户端获得优化的速度。如果用户确实想观看高清内容,您还可以允许用户覆盖它以获得高清质量
"eats all available traffic" is a good thing on the client side.
If a stream download speeds becomes slower then the time played the user will have to wait for buffering and this would be bad.
Your best bet is detect the speed of DL and if it lesser then XXX have it download a lower rez video. To do this you will need to have a few versions of the file on the server. This allows the client to get optimized speeds. You can also allow the user to override it To get HD quality if they really want to see high def