如何流式传输存储在谷歌云存储桶上的视频? [英] How to stream the videos stored on google cloud storage bucket?
本文介绍了如何流式传输存储在谷歌云存储桶上的视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已将视频存储在谷歌云存储浏览器上.我想在我的前端播放这些视频.为此,我需要视频 URL.但问题是,每当我导航到该 URL 时,文件都会被下载.
I have stored videos on google cloud storage browser. I want to play these videos on my frontend. For that I need the video URL. But the problem is, whenever I navigate to that URL, the file gets downloaded.
我需要做什么来获取我存储对象的流视频 URL?
What do I need to do to get the streaming video URL of my stored object?
推荐答案
我使用 video.js 完成了这个.
I accomplished this using video.js.
<html>
<head>
<link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
<style>
.video-js {
width: 600px;
height: 600px;
}
</style>
</head>
<body>
<video-js controls data-setup="{}">
<source src="https://storage.cloud.google.com/bucketName/folderName/recordingName.flv" type="video/flv">
</video-js>
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
<script src="https://unpkg.com/videojs-flash/dist/videojs-flash.min.js"></script>
</body>
</html>
这篇关于如何流式传输存储在谷歌云存储桶上的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文