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.

Get Microsoft Silverlight

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...

20 October 2009

Share the love:

Comments: 14

Add Comment

Tim Acheson (20 Oct 09, 11:38)

Goodbye YouTube! ;)

Tim Acheson (20 Oct 09, 16:01)

P.S. I should probably point out that this may not be the way in which SkyDrive is currently intended to be used.

Direct links to files on SkyDrive may not be permanant. Even if sharing content from SkyDrive in this way is only useful for temporary solutions, it's still useful and it's definitely good fun. ;)

I'll be interested to see how long the permanent links I use on this page will last.

Still, it's ideal for temporary usage, and perfect for prototyping, blogging, and non-production projects such as Hack Days.

P.P.S. As one would expect, in the root of SkyDrive domains there is a clientaccesspolicy.xml config file which restricts cross-domain access for Silverlight applications running on that domain:-

E.g. http://1pizoq.bay.livefilestore.com/clientaccesspolicy.xml

E.g. http://cid-9115a524920cfd6f.skydrive.live.com/clientaccesspolicy.xml

Greg Edwards (22 Oct 09, 16:25)

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.

Tim Acheson (23 Oct 09, 10:05)

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.

I'd love SkyDrive to allow direct permalinks to files.

Tim Acheson (23 Oct 09, 17:55)

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.)

Tim Acheson (23 Oct 09, 17:56)

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.

The URL structure is as follows
 
http://cid-{UserIDHex}.users.api.live.net/Users({UserIDDec})/files/folders('{folderID}')
 
HTTP request example
 
GET /Users(-7992300387211346577)/files/folders('8115A524920CFD6F!315') HTTP/1.1
Authorization: WLID1.0 t={token}&p=
AppId: 0000001207963145
Content-Type: application/atom+xml
Accept: application/atom+xml
Accept-Language: en-us
User-Agent: Favorites Sync
Host: cid-8115a524920cfd6f.users.api.live.net
 
HTTP response example
 
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/atom+xml; charset=utf-8
ETag: "0"
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
X-MSNSERVER: H: BAYxxxxxC101 V: 1 D: 9/1/2009
Date: Fri, 23 Oct 2009 16:12:07 GMT
Content-Length: 4688
 
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:live="http://api.live.com/schemas" xmlns="http://www.w3.org/2005/Atom">
      <title type="text">Launcher</title>
...

Tim Acheson (26 Oct 09, 17:27)

Update: an API for SkyDrive, facilitating permanent direct URLs

*** For full details see my blog post: SkyDrive API ***

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! :)

Tim Acheson (27 Oct 09, 15:00)

Other online storage solutions worth knowing about

Silverlight Streaming

I should add that, if you want to put video on a web site, the best way is to use streaming, which can be much more efficient than simply downloading a video file.

I strongly reccomend Silverlight Streaming.

Azure

Like SkyDrive, Silverlight Streaming is essentially a storage facility on Live.com, but also provides a proper streaming platform, like Windows Media Services.

The next level up from SkyDrive is Azure, starting with Azure Storage. There is no official storage limit on Azure, but anecdotal evidence indicates hundreds of terabytes.

TribalVista (04 Nov 09, 18:35)

Thanks for that - this is a great tip and just the thing I need.

Tim Acheson (05 Nov 09, 15:40)

My pleasure -- let me know how you get on! You're welcome to contact me if you want help.

TribalVista (09 Nov 09, 16:31)

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.

Tim Acheson (11 Nov 09, 10:43)

I see you've put MinoPlayer to good use on your website, with those embedded videos.

MinoPlayer is a very nice simple SIlverlight video player. You could use my API to store videos on SkyDrive for the MinoPlayer, or indeed any good embedable media player.

Tim Acheson (11 Jun 10, 07:55)

Update: Microsoft launches SkyDrive video player!

Tags:


  • Twitter
  • LinkedIn
  • Facebook
  • Windows Live / Messenger
  • Xbox Live
  • RSS
  • Email