从Amazon S3流的MP3 [英] Streaming MP3s from Amazon S3
问题描述
有没有办法通过一个Flash小部件嵌入在网站上,或其他一些方法来将存放在Amazon S3上的MP3?
Is there a way to stream MP3s stored on Amazon S3 via a Flash widget embedded in a website, or some other method?
推荐答案
的确是这样。首先,你需要的是所有在较低的情况下,你的S3帐户创建一个水桶,是全球唯一的,DNS兼容;因此,例如我创建了一个名为斗media.torusknot.com。
Yes it is. Firstly, you need to create a bucket in your S3 account which is all in lower case, is globally unique and is DNS-compatible; so for example I created a bucket called ‘media.torusknot.com’.
然后使这一切看起来不错,你需要创建一个DNS CNAME进入您的网站的子域名映射到S3存储。这将允许您通过 http://media.example.com访问您的文件上传到S3存储/somefile.mp3 。你只需要设置的ACL上的文件和放大器;桶以确保公共访问是允许的。
Then to make it all look nice you need to create a DNS CNAME entry to map a sub-domain of your site to that S3 bucket. That will allow you to access your files you upload to that S3 bucket via ‘http://media.example.com/somefile.mp3’. You do just need to set the ACLs on the files & the bucket to make sure public access is allowed.
最后,如果你想通过Flash播放器从S3到另一个域流的视频文件,你还必须告诉Flash,这是确定的内容将在从不同的域拉升。创建一个名为crossdomain.xml的桶中的文件,这些内容:
Finally, if you want to stream video files via a Flash player from S3 to another domain, you also have to tell Flash that it’s ok for the content to be pulled in from a different domain. Create a file called ‘crossdomain.xml’ in the bucket, with these contents:
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
</cross>
从任何地方访问
这允许媒体 - 你可以,如果你想更具体的,但是这是最简单的方法
That allows the media to be accessed from anywhere - you can be more specific if you want but this is the simplest approach.
相关资源:
- Using Amazon Web Services
- Streaming Media From Amazon S3
这篇关于从Amazon S3流的MP3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!