Silverlight Streaming: new iframe-based invocation mechanism


With a recent update to the Silverlight Streaming service, it’s now even easier to instantiate a hosted app on a web page: all you need is a single iframe element whose source attribute refers to a server-side invocation URL. You can now write something like this:


<html>
<body>
   <
iframe src=http://silverlight.services.live.com/invoke/AccountID/AppName/iframe.html

     scrolling=”no” frameborder=”0″ width=”500″ height=”400″></iframe>
</body>
</
html
>


(Note that AccountID and AppName need to be replaced with values specific to the hosted application)


Background


Silverlight Streaming is a new Windows Live Platform offering (currently in alpha) that provides scalability-on-demand for media-rich Silverlight applications. (You can find more information here)


Once you upload a Silverlight application to the Silverlight Streaming service, it’s fairly trivial to instantiate the hosted app on a web page. You could previously do it in four easy steps that look something like this: 


<html>
<
head>

<!– (1) add a script reference –>
   <script src=”http://agappdom.net/g/silverlight.js” type=”text/javascript”></script
>

<!– (2) define a Javascript function to create the hosted object; usually in a separate .js file –>
   <script type=”text/javascript”>
      function CreateSilverlight() {
         Sys.Silverlight.createHostedObjectEx({ source: “streaming:/AccountID/AppName,

         parentElement: pe});
      }
   </script
>
</
head
>
<
body
>
<!– (3) define a DIV to contain the hosted object –>
   <div id=”myApp” class
=”aghost”>
<!– (4) add a script element to call the create function –>
      <script type=”text/javascript”>

         var pe = document.getElementById(“myApp”);
         CreateSilverlight();
      </script
>   
   </div>
</
body
>
</
html
>

[Details on the individual steps can be found here, on the Windows Live Dev site. Note that the URL used in step (1) is for the Silverlight 1.0 Beta. For more information on how to reference Silverlight 1.0 RC, see the July 27th entry on the Silverlight Streaming News page]

Comments (9)

  1. Tim Sneath says:

    Catherine Heller has written up a great post that describes a new feature in Silverlight Streaming. Having

  2. Catherine Heller has written up a great post that describes a new feature in Silverlight Streaming. Having

  3. lozanotek says:

    Catherine,

    For some reason I get the following error when I try running the sample html you posted (once I replaced the application ID and name):

    Line: 26

    Char: 5

    Message: ‘Sys.Silverlight’ is null or not an object.

  4. yosit says:

    Javier,

    You’re probably using the RC.

    Cathrene used the Beta syntax.

    Make sure you have <script src="http://agappdom.net/g/silverlight.js&quot; type="text/javascript"></script>

  5. Sorry, it has been a little quite on the blog. I was on vacation last week and training down in Redmond

  6. 優使文章 says:

    Sorry, it has been a little quite on the blog. I was on vacation last week and training down in Redmond

  7. As a follow-on to the last screencast (about how to do a screencast), I’ve created a screencast that

  8. As a follow-on to the last screencast (about how to do a screencast), I&#39;ve created a screencast that

  9. A ver… tenía que contar en mi blog que Titín III había ganando, a sus 38 añazos, la txapela del 4 y