Hi, I am about 80% complete on a complete video sharing system that uses the CDN and here are a few points I considered when I designed the system.
UPLOADING
The upload was the first thing I thought about...uploading to your server before the CDN is not ideal because the purpose of the CDN (in my case) was to take the load off our servers. So the ideal thing is to get a session token from the CDN and use that to get node data for uploading to. But, as discussed this exposes the upload token to the user.
One way around this is to have a tiny SWF file that handles all tokens. The SWF is compiled, plus the token info is generated at runtime inside the SWF. Instead of passing data to the SWF when it loads, which would expose that data, you would have a load event which requests the data from your app server (i.e login info) which can then be transmitted to the SWF via SSL.
This does kind of utilize the "sledgehammer to open a walnut" situation, but would ensure that the data is safe.
Any server-side file that needs a token can request it from the SWF, which can pass it back as an RSA encrypted string, with the public key on the app server to decrypt the string.
The SWF has no visual interface so acts more like a remote class.
CONVERTING
Our code is for a media manager, not just video sharing, so we have various folders for different types of media. To further enhance usability we use a flash/ajax/php combination to produce an upload component that can upload multiple files of different type in a queued system.
> User selects 20 files of various mime type and clicks Upload Button
> File is uploaded to the correct node into a temp folder
> Once all files are uploaded, a script runs on the temp folder moving the files to the correct location
> Any video files not in FLV format are placed in an xml file which is then called later
> XML file is called via a cron script which processes the conversion using a callback to remove the files after done processing
> Original file is then deleted from temp folder
A list is included in the interface to show the user the current state of transcoding for the files so they understand if a file is not ready for sharing.
EXTRACTING
Haha! This is where I have been having trouble....sometimes it works, sometimes not.
In our situation, a file is simply that. To share that file a user must create a media object whose data is stored on the app server side. We do this because we allow the users to create playlists of objects that can later be passed to our players.
For the thumbnailing of FLV files I created a small mini-player with a scrubber bar allowing them to seek to any frame in an FLV and capture that frame.
This is what I am still on because it doesn't always work. I just tried to capture a frame and I got a response code 70002, file not found. I then entered into a browser that same url that it said was not found and viola, there it is. I'm about to post a message about this because extracting thumbs has worked for me on some occasions and not on others so it really is holding up my development.
---
I hope the above ideas help you out in your final design.
Paul