Firebase Storage: Play back of a video url directly?

可紊 提交于 2021-02-10 06:28:06

问题


I have been searching a lot about this by now and I got nothing:

I am trying to play a video from firebase storage and trying to be able to see its progress on the player as it loads and to be able to seek it backward and forward (stuff that any player does while streaming a video).

The problem:

Firebase team say that it is not possible to stream a video from the cloud storage (it is not supported).

Eventhough I was able to do this:

String url = "my_url_at_firebase_storage";

video_View.setVideoUri(Uri.parse(url));
video_View.start();

and I was able to load the video from firebase storage into a video view.

I checked:

I checked this link that has an answer that says you have to transcode the video to chunks and save the chuncks to firebase storage and then load them:

But I am lost here:

1) What are chunks of video?

2) How would you stream these chunks if firebase doesn't support streaming?

My question:

As this topic is rarely documented and the link above doesn't provide enough info about how to acheive it:

I ask:

If firebase doesnt support streaming how come we are able to load video directly to videoview?

Tried the same with exoplayer and didn't work?

Thanks for your efforts.


回答1:


"Transcoding the video into chunks" means dividing it into multiple small pieces (separate files). Those parts are then uploaded to Firebase Cloud Storage.

Once you divided the video into those pieces, you can download them. Since Firebase does not support streaming, you have to download each chunk entirely before playing, but the trick is that you only have to download that chunk, not the entire video.

Does that answer your question?



来源:https://stackoverflow.com/questions/51480449/firebase-storage-play-back-of-a-video-url-directly

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