Microsoft Silverlight is a web application framework developed by Microsoft. Initially released as a video streaming plugin, later versions brought additional interactivity features and support for .NET languages and development tools. The current version, 3.0, was released on July 9, 2009.[2]
Silverlight supports playback of WMV, WMA and MP3 media content[7] across all supported browsers without requiring Windows Media Player, the Windows Media PlayerActiveX control or Windows Media browser plugins. Because Windows Media Video 9 is an implementation of the SMPTEVC-1 standard, Silverlight also supports VC-1 video, though still only in an ASF container format. Furthermore, the Software license agreement says VC-1 is only licensed for the "personal and non-commercial use of a consumer".[8] Silverlight, since version 3, supports the playback of H.264 video.[9] Silverlight makes it possible to dynamically load XML content that can be manipulated through a DOM interface, a technique that is consistent with conventional Ajax techniques. Silverlight exposes a Downloader object which can be used to download content, like scripts, media assets or other data, as may be required by the application.[10] With version 2, the programming logic can be written in any .NETlanguage, including some derivatives of common dynamic programming languages like IronRuby and IronPython.[11]
Versions
Silverlight 1.0
File:SilverlightGame.PNGA Silverlight 1.0 application hosted in Internet Explorer. Interactivity is provided by Silverlight, but user input controls are HTML controls overlaid on top of Silverlight content
Silverlight 1.0, which was developed under the codename Windows Presentation Foundation/Everywhere (WPF/E), consists of the core presentation framework, which is responsible for UI, interactivity and user input, basic UI controls, graphics and animation, media playback, Digital rights management, and DOM integration.[12] It is made up of the following components:
Input – handling input from devices like keyboard, mouse, stylus etc.
UI core – managing rendering of bitmap images (including compressed raster images like JPEG), vector graphics, text and animations.
Media – playback of MP3, WMA Standard, WMV7, WMV8 and WMV9/VC-1 streams.
XAML – to allow the UI layout to be created using XAML markup language.
A Silverlight application starts by invoking the Silverlight control from the HTML page, which then loads up a XAML file. The XAML file contains a Canvas object, which acts as placeholder for other elements. Silverlight provides various geometrical primitives like lines, ellipses and other shapes, to elements like text, images, and media etc. The elements are properly positioned to achieve the desired layout. Any arbitrary shape can be created as well. These elements can be animated using Event triggers; some animation effects are predefined, others can be created as composite of the pre-defined effects. Events like keyboard or mouse movements can also raise Events which can be handled by custom scripts.[13]
Programmatic manipulation of the UI is achieved by using scripting languages to modify the Document Object Model of the Silverlight Canvas object.[12] To facilitate this, Silverlight exposes a DOM API, accessible from any scripting language supported by Silverlight, which in version 1.0 release is limited to JavaScript running in the browser. However, there are no UI widgets built in. The native widgets of the browser must be overlaid on top of the Silverlight Canvas for user input. Support for data formats is limited to XML and JSON only.[12]
Silverlight 2 (previously referred to as version 1.1)[14] includes a version of the .NET Framework, implementing the same full Common Language Runtime version as .NET Framework 3.0; so it can execute programs written in any .NET language. (By default, however, you cannot reference assemblies compiled with the regular .NET Framework.[citation needed]) Unlike the CLR included with .NET Framework, multiple instances of the CoreCLR included in Silverlight can be hosted in one process.[15] With this, the XAML layout markup file (.xaml file) can be augmented by code-behind code, written in any .NET language, which contains the programming logic. It can be used to programmatically manipulate both the Silverlight application and the HTML page which hosts the Silverlight control. The XAML markup as well as the code, is compiled into .NET assemblies which are then compressed using ZIP and stored in a .xap file.[16]
Silverlight ships with a lightweight class library which includes features such as extensible controls, XML Web Services, networking components and LINQAPIs. This class library is a subset of, and is considerably smaller than, .NET Framework'sBase Class Library. Silverlight code runs in a sandbox, thus preventing the invocation of platform APIs.[17]
Silverlight 2 Architecture
The version of .NET Framework in Silverlight adds[12] a subset of WPF UI-programming model, including support for shapes, documents, media and animation objects of WPF. Beta 2 onwards,[18] it ships with more than 30 UI controls[19] (including TextBox, CheckBox, Slider, ScrollViewer, and Calendar controls),[20] for two-way databinding support, automated layout management (by means of StackPanel, Grid etc)[20] as well as data-manipulation controls, such as DataGrid[14][21] and ListBox.[20] UI controls are skinnable using a template-based approach.[20] Third-party libraries of expanded UI-control sets are also available.[22]
File:SLSkin.PNGA set of Silverlight controls rendered with different skins
The included Base-Class Library (BCL) provides classes for collections, reflection, regular expressions, string handling and data access. It also supports LINQ, with full support for LINQ to Objects and expression trees. Almost all of the System.Linq and System.Linq.Expression namespaces are exposed. It also supports serialization of objects, for data persistence. Silverlight can handle data in RSS or JSON format, in addition to XML. The BCL provides enhanced support for working with XML data, including the XMLReader and XMLWriter classes. Silverlight 2 also supports asynchronous programming via the use of the threading libraries.[21]
Silverlight also includes classes for data access over XML-based Web services, REST, WCF Services and ADO.NET Data Services.[18] The networking support in Silverlight can be used by Silverlight applications to communicate using HTTP, or at the lower socket level. Cross-domain communication is supported. [19] Silverlight uses an XML-based configuration file to control the cross-domain resource-access policy, for both HTTP and socket connections. It can be used by site administrators to control which resources a Silverlight application can access, when that application did not originate in the domain of the site. In addition, Silverlight also supports the Adobe Flash Cross-domain policy file format.[23] Silverlight sockets can only initiate a connection; they cannot listen for connections.[24]
Silverlight 2 includes[18] the Dynamic Language Runtime (DLR) which allows dynamic compilation and execution of dynamic (scripting) languages. Compilers for the languages based on the DLR (including IronPython and IronRuby) are [to be?] packaged with the Dynamic Languages application in the .xap package.[25] The Dynamic Languages SDK includes a web server named Chiron, that can dynamically package all the dependencies for the Dynamic Languages application and serve it to the browser.[25] The first upcoming languages written for the DLR are Managed JScript, IronPython 2.0, and IronRuby. Microsoft also plans to build Visual Basic .NET 10.0 (VBx) on the DLR. All four languages share the same infrastructure, to allow Silverlight to compile and execute the language source. Conversely, other .NET languages must be compiled ahead-of-time and delivered to Silverlight as .NET assemblies. The implementation of Managed JScript conforms to the ECMAScript 3.0 specification, and Microsoft asserts that it is 250 times faster than interpreted JScript.[21]
With the integration of .NET Framework, Silverlight also allows HTML-managed code interaction, which enables the manipulation of HTMLDOM elements from managed code,[12] and permits JavaScript code to call managed code and use objects instantiated by managed code. Silverlight encloses JavaScript objects and DOM elements in managed wrappers to make them available from managed code.[26] While there is no provision for calling JavaScript code directly in the 1.1 alpha release, managed-code events can fire JavaScript handlers. A Silverlight instance does not need to have a UI component in order to manipulate the HTML DOM from managed code.[27] It is done by creating an XAML Canvas with both width and height set to zero, and using its code-behind code to modify the Document Object Model of the HTML page via the APIs in the System.Browser namespace.[28]
Silverlight 2 includes Deep Zoom, a technology derived from Microsoft Live Labs Seadragon. It allows users to zoom into, or out of, an image (or a collage of images), with smooth transitions, using the mouse wheel.[29] The images can scale from 2 or 3 megapixels in resolution into the gigapixel range, but the user need not wait for it to be downloaded entirely; rather, Silverlight downloads only the parts in view, optimized for the zoom level being viewed.[30] Beta 2 onwards, Deep Zoom uses an XML-based file format.[18]
WMA Professional support, including WMA 10 Pro low-bitrate modes. However, multi-channel audio content is still down-converted to stereo output.
Content protection powered by Microsoft PlayReady DRM client.
Server-side playlists in Windows Media Services.
Media Stream Source API.
The Media Stream Source is the API responsible for enabling adaptive streaming of media. Adaptive streaming allows the player application to choose the bit rate of the media based on available client bandwidth and CPU resources.[18] Media Stream Source allows the developer to specify a custom method of retrieving media data, the only requirement being that the final video and audio streams be presented to Silverlight runtime in a format that Silverlight can decode (VC-1, H.264, WMA, MP3, etc). This allows extensible support for otherwise natively unsupported file formats (i.e. MP4, Matroska, Ogg), protocols (i.e. Shoutcast) and delivery methods (i.e. adaptive streaming, P2P). Microsoft first publicly showcased Media Stream Source by powering the NBC Olympics website with their own implementation of adaptive streaming.[32]
Third-party open source Chart Control(Visifire) in action.
Silverlight 2 also allows limited filesystem access to Silverlight applications.[26] It can use the operating system's native file dialog box to browse to any file (to which the user has access). The file is sanitized of path information, to prevent the application from getting access to information such as user name, and can be opened only in read-only mode. For local storage of data, Silverlight provides isolated local storage (isostorage),[26] namely, outside the browser cache, in a folder hidden inside the private user-profile folder. It is set to 1 MB per URL by default,[26] but this can be changed by the user.[18] Data stored by a Silverlight application in the isostorage is identified by the URL from which it loads, and can be accessed by that application only. All instances of Silverlight share the same isostorage, so all instances of the same Silverlight application can share the saved data, even if they are running on different browsers.
Silverlight CoreCLR uses an attribute-based security model, as opposed to the Code Access Security (CAS) model of the desktop version of .NET Framework.[33] Assemblies are marked with a security attribute, which can be transparent (SecurityTransparentAttribute), safecritical (SecuritySafeCriticalAttribute) or critical (SecurityCriticalAttribute). Methods in transparent assemblies run with partial trust, and codes within such assemblies cannot call critical methods (methods which can cause system-wide changes); neither can transparent assemblies contain unverifiable code (use the unsafeC# keyword or use pointers) or invoke system functions by means of P/Invoke. Code in both critical and safecritical assemblies run with full trust, and are therefore not subject to such limitations. However, a transparent method can call a safecritical method, and a safecritical method can call a critical method. In such a case, the safecritical method will verify that the call is both safe and within the limited rights of the caller; if so, then the safecritical method will proxy the call to the requested critical method. In fact, the IsoStorage APIs are exposed as safecritical methods.[33] An assembly whose security attribute is unset is run as a transparent method. Analogous limitations also apply to type-inheritance; namely, in the cases of virtual-method calls and interface-method calls.[34] Silverlight assemblies can contain members that are not usable by CoreCLR, as long as they can be processed by the .NET Framework CLR; such methods will not be loaded when the assembly is being executed by CoreCLR.[35]
However, only platform code is allowed to be marked as critical or safecritical. The Silverlight runtime ensures that platform assemblies are loaded only from the Silverlight installation directory, and are digitally signed by Microsoft. This effectively means that user-application assemblies can only be transparent code (run under partial trust and limited rights).[36] Platform code can be marked with either attribute. The BCL methods of the .NET Framework, which have the Internet attribute set, allowing them to be called from untrusted code originating from Internet, are exposed in Silverlight BCL as transparent methods.[36]
Silverlight 3
File:OfflineSL3.pngA Silverlight 3 application, with one instance running in a web browser as well as installed locally. The start menu icon is also shown.
Silverlight 3 was first announced at the IBC 2008 show in Amsterdam on September 12, 2008. It was unveiled at MIX09 in Las Vegas on March 18, 2009. A beta version was made available for download the same day. The final version was released July 9, 2009.
Silverlight 3 includes an increased number of controls[37] - including but not limited to DataGrid, TreeView, various layout panels, DataForm for forms-driven applications and DataPager for viewing paginated data. Some of these controls are from the Silverlight Toolkit. In addition, Silverlight 3 includes a navigation framework to let Silverlight applications use the hyperlinked navigation model as well as enabling deep-linking (linking directly to specific pages) within Silverlight applications.[37]
On the media front, Silverlight 3 supports AAC audio decoding as well as hardware-accelerated H.264 video decoding.[37] Silverlight 3 also offers 1080p smooth streaming.[38][39] The native multimedia pipeline is also programmatically exposed, so that other formats can also be supported by third-parties using managed code decoders.[37] Silverlight 3 supports perspective 3D[37] which enables 3D transformations of 2D elements.[40] These transformations, as well as many 2D operations like stretches, alpha blending etc are hardware accelerated.[40] Custom animations, including transforms and blends, can be created on Silverlight elements using HLSL to make use of pixel shaders.[40] A Bitmap API is provided to let Silverlight 3 applications manipulate bitmaps.[40] Silverlight now uses the GPU to accelerate the composition of Visual Trees (like WPF, Silverlight elements correspond to Visual elements, which, when coupled with the layout information, forms a Composition Tree or Visual Tree which is then rendered to form the final display; see WPF architecture).[37] Visual trees can now be cached;[37] this increases performance in cases like transforms, which creates lots of throw-away intermediate states, by not making the state transitions on the main Visual tree. Silverlight 3 now also supports ClearType text rendering.
File:DesktopSL3.pngA Silverlight 3 application demonstrating local file access.
UI elements in Silverlight 3 supports element-to-element binding - which allows one element to be bound to the state of another element,[40] as well as a validation mechanism for data binding.[37] Unlike Silverlight 2, which allowed the applications to save files only to the local isostorage, Silverlight 3 applications can save to any location on the file system via the system Save File dialog. However, the path where the file is saved will still be hidden from the Silverlight application.[37] Any external assemblies used by Silverlight applications are cached too so that they need not be redownloaded for subsequent instantiations of the application.[37]
Silverlight 3 also includes a LocalConnection API to communicate (using a named pipe style model) among multiple running applications on the same machine, irrespective of the browser [37][40] and can monitor for network connectivity events.[37] Silverlight 3 can optionally use Binary XML to communicate with WCF services.[37]
Silverlight 3 supports Out-of-Browser experiences, i.e., Silverlight applications can be installed to the system for offline access (provided the application manifest is designed to allow local installation) where they run outside the browser. They are launched using the Start Menu or desktop shortcuts, and run without the browser window.[37] Applications can check whether they are running inside a browser or not.[41] When running out of browser, HTML interop is disabled. In addition, access to the Function Keys is enabled.[42] Locally installed Silverlight applications still run in a sandbox.[42]
Installed Silverlight 3 applications automatically check for updates asynchronously on every launch and updates are automatically installed.[43] Running instances of the applications are informed when updates are available.[41]
Opera will be officially supported with future builds.[49] Unofficially, Silverlight support is already available to Opera via a hack.[50]. Starting from Silverlight 2, hacks are no longer required. [52]
On Linux^, the functionality will be made available via the compatible third-party Moonlight runtime.[53][54] Moonlight will be available for the major Linux distributions, with support for Firefox, Konqueror, and Opera browsers, provided it was obtained through Novell.[55] Miguel de Icaza has expressed an interest in working with developers from other operating systems (BSD, Solaris) and other browsers (Konqueror, WebKit and Opera) to ensure that Moonlight works fine on their systems.[56]
Silverlight for Mobile will be used to run Silverlight content on mobile devices. The first CTP for Windows Mobile 6 was expected in 2nd Quarter of 2008, but it still not officially announced. Nokia has announced plans to make Silverlight for Mobile available for S60 on Symbian OS, as well as for Series 40 devices and Nokia Internet tablets.[57] Silverlight for Mobile will initially support Silverlight 2 content and .NET languages.[3]
Silverlight requires an x86 processor with SSE support. Supported processors include the IntelPentium III and up, and the AMDAthlon XP and up. Some AMD Duron models are also supported.
Additional platforms are being considered as well.[58]
On Apple's Download website, contributed by Microsoft, the system requirement stats 800MHz PowerPC G4 or onwards, however Microsoft's own website has different information. "Silverlight Download on Apple".
Silverlight applications can be written in any .NET programming language. As such, any development tools which can be used with .NET languages can work with Silverlight, provided they can target the Silverlight CoreCLR for hosting the application, instead of the .NET Framework CLR. Microsoft has positioned Microsoft Expression Blend versions 2 and 2 SP1 for designing the UI of Silverlight 1.0 and 2 applications respectively. Visual Studio 2008 can be used to develop and debug Silverlight applications. To create Silverlight projects and let the compiler target CoreCLR, Visual Studio 2008 requires the Silverlight Tools for Visual Studio.[59]
A Silverlight project contains the Silverlight.js and CreateSilverlight.js files which initializes the Silverlight plugin for use in HTML pages, a XAML file for the UI, and code-behind files for the application code. Silverlight applications are debugged in a manner similar to ASP.NET applications. Visual Studio's CLR Remote Cross Platform Debugging feature can be used to debug Silverlight applications running on a different platform as well.[60]
In conjunction with the release of Silverlight 2, Eclipse was added as a development tool option.[61]
Licensing
A PC World report stated[62] that Microsoft aims to release certain parts of Silverlight source code as open source software, but Sam Ramji, director of platform technology strategy at Microsoft, said the company has no plans to do so.[clarification needed][63] Some controls that ship with Silverlight are available under the Microsoft Public License as a part of a separate project known as the Silverlight Toolkit.[64]
Silverlight's proprietary nature is a concern to competition since it may harm the open nature of the World Wide Web. Advocates of free software are also concerned Silverlight could be another example of Microsoft's embrace, extend and extinguish strategy. Both Microsoft Silverlight and Adobe Flash are proprietary.[65][66] Flash's file formats are publicly documented standards,[67][68] as are Silverlight's [69][70]. Both use patent-encumbered audio and video codecs.
The project is officially supported by Microsoft who,[53] under an agreement with Novell, has made additional specifications, access to the Silverlight Base Class LibraryAPIs, binary codecs and test cases available to the Mono team,[54] none of which are available to other members of the public.[72]
The "covenant" under which Novell has been granted this exclusive access also specifies conditions that are incompatible with the licencing that covers most other free and open source software. As examples, it specifically requires that the software must have been "obtained directly from Novell or through an Intermediate Recipient" and that it must be "not licensed under GPLv3 or a Similar License".[55] Free software proponents Groklaw have criticized the covenant,[73] although Novell, Inc. is enthusiastic.[74]
Silverlight has received criticism for its narrow operating system compatibility, especially for keeping Linux out of their official offering. Even though they are officially collaborating on Moonlight project, Bruce Chizen, CEO of Adobe Systems, has questioned "the commitment of Microsoft to keep the Silverlight platform compatible with other OS besides Windows".[75] His concerns are based on "examples from history" where, he argues, Microsoft has launched products with promises of ongoing cross-platform compatibility that no longer apply, Internet Explorer for UNIX and Windows Media Player for Mac for example.
Relationship to existing Web standards
California and several other U.S. states also have asked a District Judge to extend most of Microsoft's antitrust case settlement for another five years,[76] citing "a number of concerns, including the fear that Microsoft could use the next version of Windows to 'tilt the playing field' toward Silverlight, its new Adobe Flash competitor," says a Seattle Post-Intelligencer article. The final judgement on the motion extended the settlement two years, to November 2009, but for reasons unrelated to Silverlight.[77] In Windows 7 beta releases the Silverlight Web browser plugin is not installed automatically, but is a downloadable optional update through Windows update.[78]
Microsoft has been criticized for not using the Scalable Vector Graphics standard for Silverlight, which, according to Ryan Paul of Ars Technica, is consistent with Microsoft's ignoring of open standards in other products, as well.[79] However, according to David Betz, a .NET specialist and Microsoft MVP, "While this seems to some to be a valid criticism and a good point to some of the web standards world, it is absolutely groundless and carries no weight." Microsoft would have altered the SVG specification to integrate it with .NET, rather than the reverse. Consequently, he thinks the "choice by Microsoft to use XAML over SVG, served to retain the SVG standard by not adding proprietary technology [to SVG]".[80]
^ ab"Covenant to Downstream Recipients of Moonlight - Microsoft & Novell Interoperability Collaboration". Microsoft. 2007-09-28. Retrieved 2008-03-08. "Downstream Recipient" means an entity or individual that uses for its intended purpose a Moonlight Implementation obtained directly from Novell or through an Intermediate Recipient… Microsoft reserves the right to update (including discontinue) the foregoing covenant… "Moonlight Implementation" means only those specific portions of Moonlight 1.0 or Moonlight 1.1 that run only as a plug-in to a browser on a Personal Computer and are not licensed under GPLv3 or a Similar License.{{cite web}}: Check date values in: |date= (help)
^"Microsoft/Novell Collaboration on Silverlight". Miguel de Icaza. 2007-09-05. Retrieved 2008-11-09. We will be supporting Firefox and Linux initially (that is our first goal) but we are looking forward to work with developers from other operating systems (BSD, Solaris) and other browsers (Konqueror, WebKit and Opera) to ensure that Moonlight works fine on their systems.{{cite web}}: Check date values in: |date= (help)
^Markoff, John (2008-08-11). "Microsoft leveraging Silverlight and riling critics". International Herald Tribune. Retrieved 2009-01-11. Others take a darker view of Microsoft's intentions and argue that Silverlight is simply a rehash of the company's 1990s-era "embrace and extend" strategy for pre-empting Web competition. "They're still playing the same games," said Michael Nelson, professor of Internet studies at Georgetown University. "It's a way to lock up the content, and it's not enabling as much innovation as we would like to see."
^Meyer, David (2008-04-30). "Mozilla warns of Flash and Silverlight 'agenda'". ZDNet. Retrieved 2009-01-11. Companies building websites should beware of proprietary rich-media technologies like Adobe's Flash and Microsoft's Silverlight, the founder of Mozilla Europe has warned.
^Pamela Jones (28 May 2008). "Shining Some Light on Microsoft's Moonlight Covenant". Groklaw. Retrieved 2008-08-25. Moonlight is safe from threat only if you get it from Novell AND DO NOT PASS IT ON, as there are no protections for downstream recipients... unless those downstream recipients get it from an 'Intermediate Recipient' defined to only include authorized resellers... It's like walking into a store and saying "I'm only going to pay half of the amount I owe and I hereby disclaim my duty to pay full price." You can try that, but the law supersedes whatever intent or desire you've expressed. At minimum, this shows how clearly they DO NOT want to coexist with GPL'd code.
^Ryan Paul. "Microsoft's Flash-killer Silverlight steals the show at MIX07". Retrieved 2007-05-06. [Microsoft]'s perpetual unwillingness (or perhaps inability) to build on existing standards is deeply detrimental to users and developers. Internet Explorer 7 is still the only major web browser that has no native support for SVG. By neglecting to use the SVG standard in Silverlight and XAML in favor of a limited and incompatible facsimile, Microsoft has once again needlessly ignored what could have been an opportunity to empower developers and help Internet Explorer catch up with browsers that are more functional and standards-compliant.
^David Betz. "Silverlight's Adoption as Public De-Facto Standard". Retrieved 2007-06-20. Silverlight can be viewed as a web extension of the Windows Presentation Foundation (WPF), a .NET 3.0 technology and not simply as a new web technology. As such, it makes sense that Silverlight uses XAML, not SVG. If Silverlight were based on SVG, then there would be a chasm between Silverlight and the .NET Framework, but as it stands Silverlight's use of XAML makes it part of the .NET family. In fact, it's important to note that elements in XAML usually represent objects in the .NET Framework; this would simply not be possible in SVG.