Speeding up firebase storage download

依然范特西╮ 提交于 2020-08-08 05:14:20

问题


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?


回答1:


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.

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.

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

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




回答2:


You can store your files in the Regional Storage, such as us-east1.

Please refer to https://cloud.google.com/storage/docs/bucket-locations and change your bucket's region to most closest place to you.



来源:https://stackoverflow.com/questions/51944523/speeding-up-firebase-storage-download

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