加快Firebase存储下载

问题描述:

我正在尝试从Firebase存储中提取视频,并将其放入我的Android应用上的幻灯片放映中,但是这些视频要花很长时间才能加载.有没有人有其他选择或方法来加快数据下载?

I am trying to pull videos from firebase storage and put them into a slideshow on my Android app but the videos take so long to load. Does anyone have any alternatives or ways to speed up the data download?

您可以做的一件事就是在上传视频时将视频分成较小的块 然后在幻灯片播放时一一下载. 这是一个好主意,因为通过这种方式,您或您的用户不必等待整个文件.您可以在第一个块可用时立即开始播放视频,然后继续在后台下载下一个. 对视频文件进行分块时,可以减少超时的风险.如果一小块由于某种原因无法下载,则可以自动重试该块,而不必重新启动整个下载.

One thing you can do is split your video in smaller chunks when you are uploading then download chunks one by one as slideshow plays. It is a good idea because by this way you or your user don't have to wait for whole file. you can start playing videos as soon as your first chunk is available and then continue downloading next one's in background. When you chunk video files, you reduce the risk of timeouts. If a small chunk fails to download for whatever reason, you can automatically retry only that chunk, instead of having to restart the entire download.

是的,当firebase下载时,它确实会卡住,但是现在它是随机的,对您没有多大用处,因为firebase会进行下载,并在完全下载文件播放时向您发出信号.

and yes when firebase is downloading it will do chucking but it'll be random and not much useful to you now because firebase'll do it for download and it'll signal you when file is fully downloaded to play.

每个流媒体服务都可以做到这一点.即使多线程下载器也可以做到这一点.

Every streaming service does this. even though multithread downloaders also do the same.

您可以在Google上找到最佳的块大小以及更多有关它的信息.

you can google to find optimal chunk size and more about it.

我刚刚谷歌搜索,看起来不错. https://www.limelight.com /blog/multiple-solutions-for-low-latency-live-video-streaming/

I just googled and it looks good. https://www.limelight.com/blog/multiple-solutions-for-low-latency-live-video-streaming/