Published
Tuesday, May 06, 2008 3:43 AM
by
mtaulty
I wanted to upload some videos to Silverlight Streaming. There's an area of the admin site that says "Manage Videos" but, unfortunately, it only lets you upload one video at a time through the web page so that could prove painful if you've a few videos.
There's an API to Silverlight Streaming so I wrote a bit of code to do my upload for me.
It's really, really, really ( REALLY! ;-) ) basic but it might help someone at some point so I've shared it here ( hopefully minus my account id and key ).
Couple of things to add;
- If you ask it to upload a lot of files and it errors part way through then it displays a blocking message box. Might not be what you want so maybe change/comment that.
- I haven't figured out how to use this to end up with all the videos in a single fileset on Silverlight Streaming. My videos currently all go into their own separate filesets and I've not managed to work out how to get them all into a single fileset. I've a sneaking suspicion that if you want to do that you have to zip them all into one zip file and upload that but that's not-so-practical if you've got a lot of videos.
Update: I've changed the code that's downloadable here. The code now also has a textbox where you can specify the FileSet and all the videos will go into that single FileSet so point (2) above is now redundant although you could easily hack the code back to make it create multiple filesets or perhaps have an option on the UI as to how it's meant to work.