Firebase存储:直接播放视频URL? [英] Firebase Storage: Play back of a video url directly?

查看:43
本文介绍了Firebase存储:直接播放视频URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我已经在搜索很多有关此内容,但一无所获:

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

我正在尝试从Firebase存储中播放视频,并试图在播放器加载时看到其进度,并能够前后查找(任何播放器在流式传输视频时所做的事情).

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).

问题:

Firebase团队说无法从云存储流式传输视频(不支持).

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();

我能够将Firebase存储中的视频加载到视频视图中.

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

我已检查:

我检查了此链接,该链接的答案是您必须将视频转码为块并将块存储到Firebase存储中,然后加载它们:

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:

但是我在这里迷路了:

1)什么是视频块?

2)如果firebase不支持流传输,您将如何流传输这些块?

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

我的问题:

由于很少记录该主题,并且上面的链接未提供足够的信息来实现这一目标:

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

我问:

如果firebase不支持流媒体,我们怎么能直接将视频加载到videoview?

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

在exoplayer上也尝试过同样的方法,但是没有用吗?

Tried the same with exoplayer and didn't work?

感谢您的努力.

推荐答案

将视频转码成块"意味着将其分成多个小块(单独的文件).然后将这些部分上传到Firebase Cloud Storage.

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

将视频划分为这些片段后,就可以下载它们了.由于Firebase不支持流传输,因此您必须在播放之前完全下载每个块,但是窍门是您只需要下载那个块,而不是整个视频.

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.

这能回答您的问题吗?

这篇关于Firebase存储:直接播放视频URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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