Published
Sunday, May 04, 2008 7:48 AM
by
mtaulty
I've been trying to use Live Services a little this week and I've been struggling somewhat and it seems to mostly come down to URLs.
I've got a Silverlight app which plays some videos. I don't want the burden of hosting those videos though for either streaming or download.
So...I figure it'll be easy. I can;
- Put the streamed videos onto Silverlight Streaming and stream them from there.
- Put the zipped videos for download onto SkyDrive and let people download them from there.
- Put the Silverlight application anywhere as it just needs to reach out to (1) and (2) above.
However, it's not so easy.
Whilst you can upload a video to Silverlight Streaming you can't so easily get a URL that links to the file you just uploaded. The URL for your video is actually quite a mangled thing and is prone to change so it's not as easy as just linking to it.
If you do host your Silverlight application on Silverlight Streaming then you can get around this because if you use the devlive:slscontrol you can use "magical" initParams values and if they contain URI's like this;
streaming:/myAccount/myFolder/myVideo.wmv
then they are translated before they hit your application by the infrastructure. Otherwise, it's pretty difficult. This is explained properly up here.
So..if I host both my application and my videos up on Silverlight Streaming then I'm ok. I can live with that :-)
However, my SkyDrive problem seems to have no solution right now. Essentially, all I want to do is upload a .zip file to SkyDrive and then get a URL for that uploaded .zip file. SkyDrive won't do this. What it does is to give you a URL to a webpage that will then let you download the .zip file. That's fine for a human in a browser but not so great if you're trying to download the .zip file from a piece of .NET code.
So, I gave up on using SkyDrive for my purposes which is a shame because "big store in the cloud" is exactly what I wanted.
For me - the upshot here is that if a user uploads a file to your service then they are very likely to want to be able to get a predictable URL to that file otherwise the value of the upload is reduced. I can appreciate that there might be good reasons for not giving the user a direct URL to their content but my view is that services are more likely to be adopted if they do.
Update 1: I'm not so sure that the devlice:slscontrol that I mentioned up above actually does the translation that I credited it with. I ended up using Silverlight.createHostedObjectEx and that worked better for me although at the time of writing I think I've hit a limitation as to how many initParams I can pass via this mechanism.
Update 2: Whilst I can get a URL from SkyDrive the "problem" I have is that if I upload foo.zip then I can't get a URL without visiting SkyDrive and right mousing on an item and then doing "copy hyperlink". That's ok for a manual process but it doesn't really work where you're trying to do something automated from a piece of code.