Tim Acheson's web site & blog

Hosting video/audio and web apps on SkyDrive

While playing with SkyDrive last night, I noticed that you can use it as free hosting for a web app and other assets. It's an ideal place to put your multimedia assets, e.g. video, audio, graphics, or even potentially RIA apps, e.g. Silverlight or Flash.

(SkyDrive is simply free online storage from Microsoft. If you have a Hotmail account, you already own a SkyDrive. So you already have access to free hosting in "the Cloud" as they say.)

So, for instance, you can use SkyDrive as a quick and easy way of adding video to a web page or blog.

Example: player app and video file, hosted on SkyDrive.

Video player Silverlight app hosted on SkyDrive (VideoPlayer.xap)

Video file on SkyDrive (test.wmv)

Note: Silverlight apps are typically packaged as XAP files, just as Flash apps are packaged as SWF files. However, an XAP file is an open standard, unlike Adobe's proprietary offering. (In fact an XAP file is just a Zip file, with the file extension suffix renamed ".XAP"!) XAP is much better, and much more versatile. This is just scratching the surface of the differences between Silverlight and Flash...

Notes

I've put a complete working demo page on my SkyDrive. However, SkyDrive serves HTML documents as downloadable files, therefore I reccomend using IE8 to view it directly on SkyDrive. Other browsers are likely to prompt you to download the HTML page, rather than opening it as IE8 will, and RIA apps work differently when running on your local hard disk for security reasons.

Silverlight apps are typically packaged as XAP files, just as Flash apps are packaged as SWF files. However, an XAP file is an open standard, unlike Adobe's proprietary offering. (In fact an XAP file is just a Zip file, with the file extension suffix renamed ".XAP"!) XAP is much better, and much more versatile. This is just scratching the surface of the differences between Silverlight and Flash...

Awesome idea, Tim. Unfortunately it's not working for me. I can see your embedded video's Play icon, but then just a big black rectangle with no video or sound. File permissions issue with SkyDrive, perhaps? Or maybe it's my corporate proxy or firewall. Definitely piqued my interest, though.

Hi Greg, yes this is because officially SkyDrive doesn't currently allow permanent direct links to a file. They did in the past and it is my hope that they will do again. (Also there are no relative links.) In the meantime, because direct links to files on SkyDrive expire, this is only useful in scenarios in which you're aware of the limitations. E.g. I would happily use this during a hack day, or for a blog/twitter post, or in a scenario where the direct reference can be updated when the link expires.

SkyDrive API

The direct link to a file is not a permanent link, it can change. The current
working direct link is present in the HTML of the public SkyDrive page for a file,
in the <a/> tag with the ID "spPreviewLink", though presumably this is not
intended for public use.

There may be an API in the pipeline. Windows Live Toolbar
does communicate with SkyDrive through a RESTful web service, e.g. when the
"Automatic Sync" option is enabled in the options for this toolbar. (You can see
the API working using a HTTP monitor like Fiddler.)

SkyDrive API: request/response example

The example below shows how the SkyDrive API works.

Again, this is purely for academic purposes. No public API has been announced
yet. A URL comprising the User ID, Folder ID and any File IDs can be requested,
with an authentication token in the request header. The response is an XML document
with the schema of an Atom/RSS feed.

Update: an API for SkyDrive, facilitating permanent direct URLs

I've created a workaround for the issue of direct links to files on SkyDrive being temporary. I can now create permanent URLs which will always redirect to the correct direct URL to a file on SkyDrive, even when SkyDrive changes the direct URL.

I did this simply by creating my own API for SkyDrive, and then using this to get the direct URL for a redirect. Ingeniously, I have named this API prototype "SkyScraper". It's a .NET library. If you want to try it, contact me and I could send you the DLL.

You could use my redirect URL right now to create permanent direct URLs for files on SkyDrive. You could also use my SkyScraper library to create your own solution -- it's open source and free to use under a standard GPL type licence.

BUT please do not use my redirector URL or my library without permission. I will require an acknowledgement where these are used. I need to keep track of who is using these! :)

Hi Tim.I havn't tried the skydrive link yet. But you may want to see what I'm doing at http://www.tribalvista.com (go to sitemap - Minoplayer page)Silverlight beta is a bit unreliable. Anyway for the moment I am just happy to link to youtube and animoto but with Windows Azure on the way I would like to get something going which is a bit more independant from them.