I’ve have been following the development of Cargo for a couple of months now and just recently signed up for a beta account. Cargo is a fantastic Personal Publishing Platform that is currently open for beta testers and provides a simple and clever way to built a beautifully simple portfolio and the ability to follow and be followed by other Cargo users.
For my new portfolio I specifically wanted to use video to showcase my projects and more specifically, Flash video. There is talk on the discussion boards of a video player component and ability to upload video being introduce to a future version of Cargo which will be fantastic. Especially if the videos get hosted and streamed from a Streaming media server such as red5 or FMS (in case any Cargo guys read through this
.
In any case I just couldn’t wait and thought it would be a fun experiment to try and create my own simple video player that I could embed in to my Cargo pages. So I spent last Thursday afternoon doing just that am I am pretty pleased with the initial results. I mentioned this on the Cargo discussion boards to say that anything is possible and some asked for a little more info. So I thought I would try and break down the process in to a few simples steps and explain what I did. It still needs a lot more work and I’m not actually going to be using this component in my final portfolio, but at least I know I can do it ).
Download the source files here.
1. First I needed to get flash in to a Cargo project, so I copied and paste the embed code from YouTube and tested it. Everything worked fine and I had successfully loaded in a swf.

2. Next I swapped out the url to the YouTube flash movie with my own swf sitting on my own server and then added an id paramenter to the url using ?id= and then a keyword.

3. Initially this didn’t load in to the page, the reason was a problem loading files across different domains. So I needed to add a crossdomain.xml file to the root of my own server that it specified the Cargo domain that was allowed to access the files and load them.

4. I was in! I now had a textfield tracing out a load of variables such as stage size, player version and any parameters added to the url. The next step was to slowly build a working video player using ActionScript, something that I’d already been working on. My existing video player needed a lot of reworking so I pretty much built it again from scratch to make things simpler but eventually got the thing loading a jpg and then when you click on the jpg or the play icon, the flv starts playing.
The swf also checks the width and the height when it is first loaded and scales and positions the controller at the bottom to nicely fit and set of dimensions.
To keep things simple I pass 1 parameter in the url and the swf loads and image and an flv with that name. Then all I need to do is create a new image and video with identical names, upload them to a specific folder on my server and call them in Cargo by appending their name as the id value.
I’m sure there’s still issues to be ironed out and it would need a lot more testing, but it’s a solid start. As I’m probably not going to be using this in my final Cargo portfolio now anyway I’ve zipped it up so anyone can download it to see how it works. You’ll also get a copy of my current video player code. None of this code is final it just worked for me and if you are interested in taking a look then by all means download it. I’m not considering using this so feel free to help yourself but I would love to hear from people who use it and definitely email me if you find any bugs, create bug fixes or extend it as I would love to know.