Microsoft’s cross-platform plug-in now includes the .Net runtime
Microsoft Silverlight is a cross-platform browser plug-in that runs in Firefox, Safari or Internet Explorer on Windows and Mac OSX. Version 1.0 has been out for a while, offering embedded video and animation, but it’s version 2.0 that is interesting for programmers, since it includes the .Net runtime.
This means you can take Visual Basic or C# code and create a cross-platform web application. Silverlight 2.0 is in beta at the time of writing, but a full release is expected by the end of 2008. Only Intel Macs are supported, but this is still an interesting option for exploring the new world of rich internet applications.
What’s Silverlight good for?
Silverlight has several personalities. In one guise it’s a media player. For
example, this line of XAML (the Silverlight layout language) defines a media
element:
Although it is set to AutoPlay, nothing will happen when the page loads,
because there is no media to play. However, you can start the music with a
couple of lines of VB:
Dim theUri As Uri = New Uri(“/audio/test.mp3”, UriKind.Relative)
Me.slplayer.Source = theUri
Silverlight supports WMA and MP3 audio, and WMV video based on the VC-1 standard. The great thing about using it is there are no dependencies on other media players being installed.
Next, Silverlight enables rich designs and graphical effects that are hard or impossible to achieve in pure HTML. You can use it for individual elements on a page, such as a menu or animation, or you can expand it to fill the entire page.
One strength of Silverlight is that it is easy to interact with the host
page. Imagine you were writing an RSS client in Silverlight and wanted to
populate a DIV element with the HTML text of a blog post. This VB code will do
it. Add an imports statement for System.Windows.Browser, then write:
Dim el As HtmlElement = HtmlPage.Document.GetElementById(“blogpost”)
el.SetProperty(“innerHTML”, theHtmlText)
Still, multimedia and design may not be the most significant thing about Silverlight, particularly since Adobe’s Flash covers much of the same ground and is more widely used. Silverlight is most interesting as an application platform. Its design and multimedia capabilities come in handy in this context too, but it is the ability to run .Net code within the browser that sets it apart.
Related articles
Q.Why are some of the keys on my keyboard doing strange...
Q.Is my phone’s Bluetooth any use?
Q.Can I switch boot drives so that I can work on older...
Old Street roundabout is being touted by the Government as the UK's answer to Silicon Valley, but it seems our best innovations are coming from all over the UK
|
|
|
|
|
Computeractive Excel (2010) Online tutorialPrice: £19.99 |
Computeractive Word (2010) Online TutorialPrice: £19.99 |
Computeractive Powerpoint (2010) Online TutorialPrice: £19.99 |
Angry BirdsPrice: £9.99 |
Back Issue CD-Rom 14 (2011)Price: £15.99 |