如何从Web下载大(> 1Gb)视频文件并将其保存到Windows Phone 8? [英] How to download and save large( >1Gb) video files from web into Windows Phone 8?

查看:92
本文介绍了如何从Web下载大(> 1Gb)视频文件并将其保存到Windows Phone 8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows Phone 8上创建一个应用程序,该应用程序需要从Dropbox,SkyDrive等下载大型视频文件(> 1GB或2 GB),并将其保存到Windows Phone音乐和视频文件夹中。

I am creating an app on windows phone 8 which needs to download large video files (>1GB or 2 GB) from dropbox, skydrive etc, and save them into windows phone music and video folder.

所以我的问题是:


  1. 如何将大文件下载成块,这样我可以避免outofmemoryExcepetion。 / li>
  2. 现在,我可以将较小的视频文件保存到相机胶卷文件夹中。如何将视频文件保存到Windows音乐视频文件夹中?


推荐答案


  1. 假定服务器支持它,则可以使用HTTP Range 标头指定服务器应响应请求而返回的文件字节。

    然后,您会多次请求将文件分段,然后将其重新放回设备上。

  1. Assuming that the server supports it, you can use the HTTP Range header to specify which bytes of a file the server should return in response to a request.
    You then make multiple requests to get the file in pieces and then put it all back together on the device.

SDK会当前不支持将视频保存到设备库的方法。您可以做的最近的事情是将文件保存在应用程序的IsolatedStorage中,然后将其添加到库中的新列表中(通过 WriteAcquiredItem )。

The SDK does not currently support a way for saving video into the device library. The nearest thing you can do is save the file within the IsolatedStorage of your app and then add the item to the new list in the library (via WriteAcquiredItem).

这篇关于如何从Web下载大(> 1Gb)视频文件并将其保存到Windows Phone 8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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