Advertisement

silverlight: embedding the plugin

so what happens when you want to embed in your page?  well if you have absolute control over your site, you may not need to worry as you'll post your silverlight applications as-is.  but what if you want to just output some smaller silverlight applications in specific areas in your site, blog, etc?

enter .  this was announced at mix07 where you get 4gb storage for free.  now, there are some caveats that you should read about -- the 4gb is total storage, but the per-app upload has some limits...so be sure to read...it may not meet every need.  but if it does, you'll have to know some things.

first, the "streaming" has been throwing people off, and i think i understand why.  our techno geek brains are telling us that "streaming" means media files directly.  because of this people have been asking me they thought you'd upload a wmv file or something and the silverlight streaming would provide a player, etc. as the output.  not so.  is enabling you to host/stream the entire silverlight application.  so basically you develop the wicked-cool-super-slick and want somewhere to host it, the xaml files, associated media, etc.  boom, may be a solution to you.

now, you may have your app, go to silverlight.live.com and then say, huh, now what?  well first you should probably take a look at the sdk link (on the left), then on the right there is a link for create application (under the essential links).  there is some important information for you here.  the most important is the creation of a manifest.xml file.  this is describing your application files requires, your manifest, etc.  it will look something like this:

<SilverlightApp>      <source>Scene.xaml</source>      <width>400</width>      <height>50</height>      <jsOrder>          <js>Silverlight.js</js>          <js>Scene.xaml.js</js>          <js>Default.html.js</js>      </jsOrder>  </SilverlightApp>

once you have that, you need to zip all your files up...except certain ones :-) -- like .media, .html, .aspx, .zip (more on this one later).  you'll have a zip file that might look something like this:

once uploaded, then you'll have to follow the silverlight embed directions (a 3 step process -- or 2 if you don't want to create another file).  below i've embedded in this blog post: 

go ahead, click it :-)

the core of the functionality is in the third step the instructions provide you which will look something like this:

function CreateSilverlight() {    Sys.Silverlight.createHostedObjectEx( {      source: "streaming:/217/SimpleButtonClick",      parentElement: SimpleButtonClickWrapper});  }

okay, now for a few gotchas i've found early on.  first, the complexity of your silverlight app may get your frustrated when you upload it.  for example, i've taken an output player from expression media encoder and it didn't exactly work (although i'm still troubleshooting it, i suspect i know some problems).  one of the reasons why is that it uses some createObject funkadelicness when creating the initialization of the event handlers, etc.  because of this you'll have to look at the loadFunction and onLoad parameter nodes of the manifest file.

second, i am assuming that silverlight streaming is leveraging a feature of silverlight that enables you to compress your assets (or perhaps your entire application) in a zip file.  then using items like the downloader, you can download the zip file (which might be considerably smaller and save some bandwidth) and then pull out what you need from the zip.  it is quite cool, and i have a sample in another post (subscribe now, hint hint).  anyhow, where was i?  oh yeah, well .zip files are not allowed to exist within your .zip application...wait, does that make sense?  basically if you are using that mechanism, it might not work in the silverlight streaming scenario...quite frankly it didn't work for me...maybe more to come on that.

so start your silver-engines, and download some tools, build some apps, upload them and host them...giddyup.

  1. 5/4/2007 4:49 AM | # frustrated
    its very dificult to upload silverlight application files on the server. its increases confusion and frustrated
  2. 5/11/2007 1:01 PM | # re: silverlight: embedding the plugin
    I agree it's frustrating trying to upload something.
  3. 5/12/2007 1:32 AM | # re: silverlight: embedding the plugin
    By "rich controls" I meant that we'll be adding many more higher-level controls (Buttons, Treeviews, DataGrids, etc) that are built using this model and which will make developing applications much easier.
  4. 5/23/2007 11:44 AM | # re: silverlight: embedding the plugin
    Your assumption that the application is downloaded as one big ZIP file and unzipped on the client is incorrect. You upload a ZIP file, but he server unzips all of the files and they are served up to the client on request (at a special super secret URL). Just look at the app using Fiddler and you'll see what I mean.
  5. 5/23/2007 12:08 PM | # re: silverlight: embedding the plugin
    donavon: correct -- i learned this very quickly after the first day that it was not the same technical implementation -- what is odd though is that the streaming service still does not enable to you upload .zip files to your package.
  6. 6/2/2007 12:40 AM | # re: silverlight: embedding the plugin
    good site!
  7. 6/28/2007 2:39 AM | # re: silverlight: embedding the plugin
    Where do you put the media files?
  8. 6/28/2007 8:31 AM | # re: silverlight: embedding the plugin
    the media files can be uploaded with the streaming service (if it meets the size requirements) or somewhere else on the web and use a URL to them as the mediaelement source property.
  9. 7/16/2007 2:43 PM | # re: silverlight: embedding the plugin
    So can you create say, an mp3 player and embedd it in your MySPace blog? They do not allow javascript. If the answer is not then this is worthless.
  10. 9/5/2007 12:03 AM | # re: silverlight: embedding the plugin
    its very dificult to upload silverlight application files on the server. its increases confusion and frustrated

  11. 10/9/2007 9:09 PM | # re: silverlight: embedding the plugin
    Where do you put the media files?

  12. 10/17/2007 12:39 AM | # 英文翻译



    href=http://www.metermart.com/company/pretermission/?memberID=dggaoxin>破裂强度试验机
    同声翻译
    英语翻译
    英文翻译
    翻译
  13. 6/23/2008 9:36 AM | # <br />Ezequiel Jadib&amp;#8217;s Blog &amp;raquo; Silverlight: Where to start?
    <br />Ezequiel Jadib&amp;#8217;s Blog &amp;raquo; Silverlight: Where to start?
  14. 10/31/2009 2:22 AM | # davetiyeci
    güzel davetiye ve davetiye metinleri

 
Please add 1 and 8 and type the answer here:
First time here? You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting! (hide this)