Some ways you can use Bime:

“Consulting: create dashboards for your customers to show them your findings”
Streaming video from Amazon S3 to a Flex application

Streaming video from Amazon S3 to a Flex application

View Comments

Let’s say, you want to stream videos into your RIA (Flex or Silverlight). Indeed, with that in your toolkit you can deliver crazy contextual video tutorials or build the latest youtube on steroid. Nevertheless, you should face many problems involving crossdomain security, more servers to manage, deployment issues etc… Hopefully, we have a simple solution for you.

  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Twitter

Let’s say, you want to stream videos into your RIA (Flex or Silverlight). Indeed, with that in your toolkit you can deliver crazy contextual video tutorials or build the latest youtube on steroid. Nevertheless, you should face many problems involving crossdomain security, more servers to manage, deployment issues etc… Hopefully, we have a simple solution for you.

Solution 1: the wrong way

You take care of hosting the videos file on a server behind the same domain you served your RIA application. This is important because you can’t stream videos (or anything for that it matters) from another domain unless it has a liberal crossdomain.xml file in the root or unless you proxy request (a pain). Forget YouTube, Vimeo and any major video delivering solution.

Problems: all rely in the solution= “you need to take care of the files”. Here come a bunch of problems: files are most of the time pretty big. You will need to back them up, you can’t check them in your source control or they slow down your deploy to a new server and explode your repository size, you can, of course, host them on a separate server but, hey, it’s a new server to manage etc…

Solution 2: the easy way

You can simply put your videos (and all your static files by the way) on Amazon S3. I hear your inner geek: “but Amazon S3 don’t have a a liberal crossdomain.xml file!”. Yes but they have virtual hosting of bucket. It means you can have a cname that points to S3 in your domain.

For example: videos.wearecloud.com can point to a S3 bucket available at videos.wearecloud.com.s3.amazonaws.com. For the Flashplayer it is exactly the same domain that served the RIA application, hence no security error. For you, it is a whole new world of easy video streaming in your RIA with nothing to worry about.

The steps

1) Create a bucket that matches the hostname you want. Let’s say “videos.wearecloud.com”

2) Create a CNAME on your domain like that:

videos.wearecloud.com CNAME videos.wearecloud.com.s3.amazonaws.com

nota: the exact process depends of your DNS hosting but it should be pretty easy and, in general, involves a DNS zone file.

That’s it. In your Flex app you can:

<mx:VideoDisplay autoPlay="true"  source="http://videos.wearecloud.com/yourvideo.flv" />

Going further

On the performance side, we are so far pretty happy with this solution. But let’s face it: it is not yet as fast as with a FMS in the basement. Nevertheless, amazon annouced a few weeks ago CloudFront, that is basically a Content Delivery Network (CDN) on top of S3. An simple API call make your bucket redundant across the globe for faster delivery.

We didn’t test this yet, but it should be an effective way to speed up the solution. Let us know if you test this out or if you have any trouble with the steps above.

Ready to try Bime? Take the free trial

  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Twitter

Author:  Nicolas is responsible for IT, data visualization and design at We Are Cloud.


RSS Feed of We Are Cloud

User Comments

  • October 26, 2009

    Good article. One question: Is this actually streaming the file or is it progressive download? If it is streaming, can you detail a bit more about the inner workings of the SWF? From your description it sounds more like a progressive download than an actual streaming file, but it’s hard to tell.

  • October 26, 2009

    I’m going to guess that it is not streaming.

  • October 26, 2009

    I wish I read this before i took the wrong way, it could have saved me a lot of time. thank you!

  • December 28, 2009

    Good read. I have the cloudfront and s3 setup, and am trying to stream video to my site with the JW Player. To “stream” video, I have read that you have to upload the client player(in my case JW player5) to a Amazon S3 bucket. Then use it as a “Download” to provide the viewer the JW player from S3 directly. For the video file, you have to upload it to S3, and then enable Distribution through CloudFront. I downloaded CloudBerry Explorer to use with the AWS, and once my video is Deployed, I have read, that I copy the RTMP address of the file, and put as the source in the JW Player code. This is where I’ve ran into an issue, I don’t know if my RTMP link(which is supposedly the Streamming link) isn’t working or what. I can get my video to come up in a browser when I copy the http from the properties of the video file in CloudBerry, it plays in Quicktime and not JW which made me wonder. I just need to know more about the cross-domain.xml and just the overall process of how to get my streaming CloudFront video to embed and play w the JW Player on my web site. Can someone help?

Post a Comment

Your email is never shared. Required fields are marked *

*
*
blog comments powered by Disqus

Blog categories

Tags

bime business intelligence cloud computing corporate dashboard data analysis data visualization design event flex gartner google analytics optimization RIA saas salesforce security SMBs startup video