简体   繁体   English

在Google云端存储中使用HTML5视频标签“ src” URL的问题

[英]Questions using an HTML5 video-tag 'src' URL in Google cloud storage

I'm designing/developing a simple HTML5-based webpage. 我正在设计/开发一个基于HTML5的简单网页。 But, rather than having the videos (eg MP4 and/or WEBM files) based locally on the web-server, I want to store them all in Google 'cloud-storage', by referencing them with a full URL in the 'src' attribute of a tag. 但是,我不想将视频(例如MP4和/或WEBM文件)本地存储在Web服务器上,而是将所有内容都存储在Google的“云存储”中,而是在“ src”中引用完整的网址标签的属性。

So, my first question is simply whether it's possible to derive such a reference URL, to a video file that I've uploaded into my Google acct's basic 15-GB of free storage? 因此,我的第一个问题是,是否可以将这样的参考URL导出到我上传到Google acct基本15 GB免费存储空间的视频文件中? (Or do I need to first buy an 'official' starter unit of Google Cloud Storage?) (或者我是否需要先购买Google Cloud Storage的“官方”入门单位?)

Secondly, could someone please point me to a tutorial or 'recipe' for how to compute such a URL, so that I can build a simple initial prototype to validate such a design approach. 其次,有人可以为我指出如何计算这样的URL的教程或“食谱”,以便我可以构建一个简单的初始原型来验证这种设计方法。

TIA... TIA ...

Dave 戴夫

It's actually almost trivial (once I bit-the-bullet and registered for a 60-day free trial of "Google Cloud Platform".) 实际上,这几乎是微不足道的(一旦我对项目进行了测试并注册了“ Google Cloud Platform”的60天免费试用版。)

It seems those older-style URLs (full of long strings of hex-chars) are a thing of the past. 那些旧样式的URL(到处都是十六进制字符的长字符串)似乎已经成为过去。 That actually makes sense, since the 'bucket name' that you create to store your files in, must be "globally-unique" and becomes part of the URL. 这实际上是有道理的,因为您创建用于存储文件的“存储桶名称”必须是“全球唯一的”并且成为URL的一部分。

https://storage.googleapis.com/your-bucket-name/Steve_Jobs-2mins.mp4 https://storage.googleapis.com/your-bucket-name/Steve_Jobs-2mins.mp4

So, it becomes as simple as just using their 'console' tool to create a bucket, upload your file(s) into that bucket, declare each 'public/shared', and then reference the resulting URL in the 'src' attribute of your video or source HTML tag. 因此,这就像使用他们的“控制台”工具创建存储桶,将文件上传到该存储桶,声明每个“公共/共享”,然后在的“ src”属性中引用结果URL一样简单。您的视频或源HTML标签。

You can view my working example here: http://weasel.firmfriends.us/HTMLVideoFromCloud/ 您可以在这里查看我的工作示例: http : //weasel.firmfriends.us/HTMLVideoFromCloud/

[ For details, you can 'view page source' on the HTML. [有关详细信息,您可以在HTML上“查看页面源代码”。 ] ]

Cheers... 干杯...

Dave 戴夫

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM