Streaming MP3s from Amazon S3

后端 未结 3 1050
陌清茗
陌清茗 2021-01-29 23:30

Is there a way to stream MP3s stored on Amazon S3 via a Flash widget embedded in a website, or some other method?

相关标签:
3条回答
  • 2021-01-30 00:04

    To update the answer to this question, if you want to actually STREAM to clients, you can use Amazon Cloudfront on top of your S3 bucket (as mentioned by Rudolf). Create a "streaming distribution" in Cloudfront that points to your S3 bucket.

    This will stream via RTMP (good for web and Android devices). You can use JW Player or a similar player to play the streamed files.

    Cloudfront Streaming uses Adobe Flash Media Server 3.5.

    There is also the ability to play secure content using signed urls.

    0 讨论(0)
  • 2021-01-30 00:08

    If you're referring to "true streaming" (not progressive downloads), you cannot do it with just S3.

    You need to store the file on S3, use MediaConvert to convert your mp3 into a HLS stream (I recommend HLS compared to the others), which breaks down your mp3 into a .m3u8 and .ts files, then use a player like VideoJS, and then you can play the audio as a true stream.

    Or you can also use a s3 audio streaming player like https://s3mediavault.com/demo/s3-streaming-audio-player/

    0 讨论(0)
  • 2021-01-30 00:12

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

    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.

    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.

    Related resources:

    • Using Amazon Web Services
    • Streaming Media From Amazon S3
    0 讨论(0)
提交回复
热议问题