Pacific Connection(英語)

It’s Mostly Smooth Sailing for Early Silverlight Developers

The early adaptors seem pretty happy with Silverlight, Microsoft’s cross-browser, cross platform competitor to Macromedia Flash. Microsoft launched Silverlight last April with a .NET-compatible version 2.0 (previously v1.1) due in early 2008. Back then, Microsoft also announced several early development projects, mostly media players and related applications. Some of these early announcements have since faded from view, but other developers are, by their own account, well underway and encountering few problems.

None of the four developers profiled here claimed that Microsoft’s new plug-in will displace Flash. But for certain kinds of installations, especially those with a large inventory of Windows Media files, Silverlight has been welcome news: a way to create a consistent look and feel whether the user is running Internet Explorer, Firefox or Safari; Vista or XP, OS X, or Linux. Even with the PC’s dominant share, that consistency was important to these developers. As with any new software, the early adopters withstood the pain that comes with early adoption: complaints included changing specs and vague documentation. On the other hand, the developers received plenty of attention from the Silverlight development team, including person-to-person meetings. By many accounts, the Silverlight team responded as if they were a hungry startup. So far, so good.

Liquid Compass: Custom Players for Radio Stations

Liquid Compass typifies what many developers will be doing with Silverlight-and why they will be doing it. The company is using the Microsoft technology to create a player for radio stations to do streaming media. ⁠We put radio stations on the Internet,⁠⁠ said Andrew Ronchetti, Liquid Compass CTO. The company had been using a custom embedded Windows Media Player, which looked and behaved differently depending on the browser and platform. For Liquid Compass’s customers, having a player with a consistent look and feel was important. Ronchetti described it as the ⁠trickle down effect⁠: if the listeners are happy, the advertisers are happy because they get more online exposure. And if the advertisers are happy, the radio stations-Liquid Compass’s immediate customers-are too.

Before moving to Silverlight, Liquid Compass already had a Flash player up and running. ⁠It wasn’t as efficient as we would have liked, and so we eventually reached a crossroads: we could either put our resources into creating a better Flash player, or take a chance with this thing called ⁠Silverlight⁠⁠ that we kept hearing about.⁠⁠ In early 2007, Ronchetti met a Microsoft engineer connected with Silverlight at a Las Vegas trade show. ⁠That piqued our interest. We came back and listed the minimum capabilities we would need from Silverlight: the must-have features and the nice-to-have stuff. I have to give kudos to Microsoft. We sent these emails off to guys that I had met face-to-face for ten minutes, and the next thing we knew, we were sitting down with them in Seattle.⁠⁠ That was in April 2007, and Liquid Compass has been working with the Silverlight development team ever since. The prospects look good. Ronchetti said that creating a variation of a player on behalf a customer once took a day. With Silverlight, it takes less than 30 minutes. ⁠The difference is the reusability of code within Silverlight, as opposed to having to deal with the exceptions on the Windows Media side of things dependent on the browser and platform.”

One challenge facing Liquid Compass’s development team was in dealing with some functionality that was available in Windows Media, but is missing in Silverlight. For example, with the embedded WMP, metadata can be sent within an audio stream and decoded by the player. ⁠The ability to do that while the listener is watching and listening allows us to dynamically set up different links, different advertisements, and different pieces of content. We had to rethink all that, but working with the Silverlight team, we’ve been able to achieve something similar.⁠

On the other hand, a Silverlight advantage was the ability for design and development work to proceed in parallel, which Ronchetti found difficult to do in Flash. ⁠With Silverlight, you can start a project out with a wireframe, and then send the design team off to do their work to create a customized look. They place design elements wherever they like, animate how they want, and the buttons themselves will retain the standard nomenclature that both design and development have agreed on. That means that the development team can work on the coding and scripting while the designers are still at work. By having a common nomenclature-XAML-all the way through, you can do all the coding and scripting on one end, while the design is being done on the other end. It’s then very simple to put the two pieces together. If something isn’t working, troubleshooting is much easier because the development team can look at the XAML code generated for the design. You could develop players that look like an apple, a banana, and an orange: but as long as the buttons are all named the same, debugging is just a matter of dealing with the same snippet of code.⁠

AKAMAI: Building Silverlight development tools

Akamai Technologies in collaboration with Microsoft is developing a set of tools for deploying Silverlight applications. Product Line Director Tim Napoleon describes Silverlight as an abstraction layer for presentation. Whereas Windows Media Player is a thick client application, ⁠Silverlight is designed for an in-page, on-Web experience. It’s lightweight and has very robust multimedia capabilities, but is designed more as an object model for developers to deploy.”

Napoleon’s team went directly to Silverlight 2.0, working with Microsoft and other developers to create class files for .NET that allow Akamai customers to create, among other things, their own ready-to-go players. The class files are available via an open source license. ⁠You can build a rich, multimedia application, embedded on a page or standalone, without having to spend any time developing the lower level functions,⁠⁠ Napoleon said. ⁠The early adopters are building things like syndication widgets⁠⁠ that enable, say, Silverlight content to be played back on a video blog. The genesis for such projects often begins with a marketing person looking at his or her company’s library of Windows media content, which could be used as part of a more site-specific media experience by creating a custom player. ⁠They hand the project off to the design team, who roughs out the look and feel.⁠⁠ A .NET developer might then convert the design into working code.

The advantage of Silverlight, said Napoleon, is in the ability to support multiple browsers while still leveraging WMP content. To do this kind of project using Windows Media Player, ⁠you would have to embed an Ajax or Java application that is often browser- or platform-specific, which meant that Mac people using Safari couldn’t participate. Whereas Silverlight is self-contained, with the ability to support both the Mac and the PC.⁠⁠ Of course, Flash is also ⁠platform-agonistic,⁠⁠ But Napoleon argues that Silverlight is a better fit for people who are more familiar with Microsoft development methodologies-.NET developers, for example-⁠whereas somebody who is more versed in Flash may want to continue to use Flash.”

Akamai began developing its Silverlight framework as a means to get consistency among customer-produced players. ⁠We have tens of thousands of websites and customers, so for us, it’s a huge advantage for them to all standardize on best practices around developing media players. We’ve invested a lot of resource and engineering time to perfect those best practices, bundle them, and put them in the hands of our customers.⁠⁠ The development team included about five developers working with Microsoft for about four months, even while Silverlight was under development. Some of the lessons learned from the project were incorporated into Silverlight’s design. All work was done in C#.

“The concept is that in Visual Studio or your favorite .NET development toolkit, you get a player that you can incorporate into your project, compile and run. Underneath are a series of class files-classes that implement things like connecting to the network, playing back a stream, and dealing with bandwidth protection, as well as routines to render UI elements.⁠⁠ These impose some consistency on the interface. ⁠For instance, we like everybody to incorporate Media RSS. Doing so means that the player can parse the RSS and render a nice looking playlist. When you click on that playlist, all the player’s corresponding buttons and controls work as they are supposed to.”

Napoleon thinks Silverlight’s potential goes beyond media players. ⁠Media applications are what first come to mind. But think of how much more visual applications, in general, are getting. If you have a Visual Basic application and you want to ⁠skin⁠⁠ that with high resolution charts and graphs, Microsoft didn’t until now have a great answer for you. Silverlight has provided a robust animation engine for everybody who is doing back end .NET development.⁠⁠ That appears to be the general direction Akamai itself is going. ⁠We fully support Microsoft and Silverlight, so I imagine you’ll see all sorts of applications running on our network that use .NET.⁠

Napoleon advises prospective Silverlight developers to pay attention to the difference between the Silverlight versions. Even though, at this writing, version 2.0 is only in alpha release, the advantages of .NET over JavaScript support may be worth the wait. Napoleon also suggests that Silverlight offers comparable benefits to Flash, rather than overwhelming advantages. Akamai will continue to support both. ⁠There’s a big learning curve for Flash, and also for .NET. I don’t see the need to switch over to Silverlight if you have a competent Flash team. Likewise, Silverlight helps out a lot of the .NET developers who have already standardized on Visual Studio: now they have a viable alternative.

On the other hand, Akamai users have given high praise for Microsoft’s open standard VC-1 codec, a competitor to MPEG-2 and MPEG-4. (VC-1 is the standardized version of Windows Media Video 9, as certified by the Society of Motion Pictures and Television Engineers.) ⁠Our customers like the quality and the sound, but have felt a bit hamstrung because they didn’t have a viable solution to render and playback video on the Mac platform. With Flash, once you author your runtime, it will play on the Mac and the PC-and that is very compelling. When you are trying to eke out every dollar you can for an advertising-supported site, the 13-20 percent of your audience composed of Firefox and Mac users is significant enough to tip the balance to Flash instead of Windows Media.⁠⁠ Silverlight gives .NET developers a comparable write-once, play-anywhere capability with VC-1 support. ⁠This is significant because some companies have millions of assets that have already been encoded into the Windows Media format.⁠

Napoleon also suggests that prospective Silverlight developers get familiar with the underlying concepts of multimedia development. ⁠Where a lot of .NET applications have been page-specific-post a page and respond-with Silverlight, you have to think more in terms of a very tight event-driven model. Long gone will be the days where you could anticipate the users⁠⁠ trajectory through the application.”

BLITZ: building a visual search engine

The Los Angeles interactive advertising agency BLITZ has used Silverlight to create a search engine and player for its client, The application, which is still in the test stages, gives a visual ⁠fly-through⁠⁠ component to video searches on the site. The circumstances were unusual. Historically, distributed its video in the Windows Media Video format, but later added support for the Flash player. ⁠The way their site was set up, if you didn’t have the Flash plug-in installed, which is rare, it would default to embedded Windows Media Player and play back as Windows Media,⁠⁠ said, Noah Gedrich, BLITZ director of technology. ⁠But that option is limited to Windows machines. So this was a great opportunity for Silverlight, if BLITZ could come up with something comparable.”

It wasn’t that easy. Gedrich called’s Flash player ⁠ incredibly fully-featured, blowing away YouTube’s video player in terms of the features, like slow-motion playback.⁠⁠ The client was understandably skeptical, so BLITZ, who was interested in Silverlight, proposed an alternative project: a customized visual search engine interface. ⁠There was already an API for searching the video catalog of videos and returning an XML file. Given the way Silverlight works, that file was a good opportunity for us to do something with those search results.⁠⁠ The result became Spatial Search, and having developed it, BLITZ went ahead with a Silverlight-based video player that duplicates Break’s Flash player functionality. Gedrich says the two players are so closely designed that users won’t be aware of the difference.

“Video is Silverlight’s strong suit,⁠⁠ Gedrich said. ⁠We show 12 thumbnails on the screen at any given time, and Silverlight is perfectly capable of playing back all 12 videos at the same time-without any performance issues. That’s pretty impressive, but we realized that the bandwidth costs would present a challenge. Because Break is not configured yet for Windows Media streaming, we would have to do a progressive download of each video. If you load each video playing back at an average size of 8-20 MB, that amounts to around 160 MB.⁠⁠ Gedrich noted that the bandwidth requirements drop if the video is pre-loaded and cached. ⁠And if you are set up for Windows Media streaming, the cost drops significantly because you only have to use as much bandwidth as required by the first five seconds of playback. So the potential is there.”

The BLITZ development team took about a month for the pilot project. The design was created in Adobe Illustrator then imported into Microsoft Expression Design for conversion to XAML, with animation done in Expression Blend 2. The end result is a fly-through with eight thumbnail videos, four large primary ones, and another four small secondary ones, each previewed with a mouse rollover. Click on the ⁠forward⁠⁠ button and the secondaries move in to replace the primaries, with four more secondaries taking their place. All the creative and animations were done in three weeks by two creative directors jumping back and forth and between projects-the staffing equivalent of a single person. ⁠At the same time, BLITZ’s Silverlight developer focused on making sure that all of the calls to their Web service would work. Once the creative work was done, the task was to wire all the animations so that they actually changed out the data.

As with Akamai, Gedrich leans toward starting with the .NET version of Silverlight. ⁠The downside of JavaScript is that not all browsers handle it exactly the same way. The biggest difference we ran into with the Spatial Search app was XML parsing. In IE, it’s easy because there is an ActiveX control for JavaScript that does XML parsing that gives you complete control: it’s great. But you can only use it for half of your code and then you have to re-write it again as Firefox and Safari. With Silverlight 2.0, the problem goes away because the distribution includes XML parsing built into the .NET framework.⁠

Gedrich also suggests that developers stay with the tools they are most familiar with, which is more likely to be those from Adobe. ⁠One of the great things about Expression Design is that it can import just about anything, and then export it as XAML. It’s faster for people not yet used to working with the Expression tools to go that route. Microsoft knows that they are not Adobe, which has been in the creative Web development tools business for quite a while, whereas this is Microsoft’s first pass. Most of their tools are version one products, so they are learning as they go, and are soliciting developer feedback. Gedrich says that Microsoft is focusing on the software development workflow.

“This is where the great potential is-where you start in one file format and you never leave that format. With Adobe Photoshop you have to translate that into Flash: you can’t go backwards. But with once you get XAML into Blend, you can move it into Visual Studio, do some work, then move it back into Blend: which means there’s no disconnect between what the designers and the developers are doing. Historically that’s been an issue with Flash development-separating code from presentation. As a result, with Silverlight, we’re going to see more specialization, with people working in the fields they know best. People are holding out for Silverlight 2 because they want to be able to leverage all of the great .NET developers, whereas there are fewer people doing cutting edge work in JavaScript, because it’s an older, less powerful technology. Once you get the opportunity to use C# for your development, you get all of the people who are hard core C# fans on board to start developing, and that’s where Silverlight is going to take off.”

Granicus: Streaming video for governments

San Francisco-based Granicus Inc. builds tools for creating and managing streaming video on government websites. The company has used Silverlight to build a video player, which was developed by the company’s chief technology officer, Javier Muniz, in about 30 days using JavaScript. ⁠We have long history-since 1999-of being a Windows Media shop,⁠⁠ said Muniz. ⁠When the Silverlight player came along, it was a natural fit.⁠⁠ Muniz says that streaming video of city council meetings and other public forums is more accessible than the common alternatives: broadcasting over public access television or making video cassettes of meetings available on request. Broadcasting online is easier to access and navigate.

Granicus was on the brink of developing a Flash player when Microsoft contacted the company about Silverlight. Muniz had good reason to switch. ⁠Adopting Flash would have meant transcoding more than 200,000 hours of Windows Media video. With Silverlight, we just change a little HTML, produce a little XAML and add a little JavaScript-and we’re done.⁠⁠ The advantage of Silverlight over Windows Media Player, says Muniz, is a more flexible, portable interface. ⁠As long we abstract away from the document object model of the browser itself, the Silverlight plug-in remains the same across platforms and browsers. For example, if we want the player to support closed captioning, we only need to write that code once. With Windows Media Player we would need to have specific code tailored to the way that the plug-in worked with the browser. And even then, we weren’t guaranteed support for some of our more advanced features.⁠⁠ At this writing, Munoz has built a test version of the player. Long-term, users will be given the option of installing the Silverlight plug-in or continuing to use WMP.

“For closed captioning, which is an integral offering among our government clients, Silverlight allowed us to take the captions out of the video file itself and put them in an external XML file, and the same thing for all of our other interactive features. They are now external to the video file itself. So when somebody wants to make a change to an index point or a slide, they don’t need to re-encode the video as they once did. All of the information about the kind of interactive point is held in this secondary XML file: XAML- the schema definition. Beyond that, with Silverlight, we can choose, say, whether to put the closed captioning on top of the video or below it; and we can display thumbnails of clips similar to the way YouTube does, which also wasn’t possible with Windows Media. All this and more has been possible with Flash, but Windows Media didn’t have an answer until now. In fact, we were looking at adopting Flash until Silverlight came out.”

Why didn’t Muniz go with Flash? ⁠With Flash 9, your UI and code were mashed together into the Flash file-although this is changing with Flex. With Silverlight, we can separate the two. With the UI defined in XAML, we can easily interchange different UIs to our application. Ultimately, our clients would like to have news outlets linking directly with their online video. And one thing that would help that adoption is if that news agency or media outlet can make the look and feel of the player fit with what they’ve already got on their site. You can accomplish all of this in Flash or in Silverlight, but it’s a question of how much work do you want to do to get there. Silverlight makes it very easy because we can customize the UI without having to change the code. It’s not all wrapped into one file as it is with Flash-although Adobe is changing this with Flex.⁠

Muniz plans to move to .NET when Silverlight 2.0 becomes available, but is waiting to see what .NET components are supported before deciding what other projects to take on. He is a strong advocate of the Microsoft tool suite, especially Expression Blend. ⁠It’s like Visual Studio for XAML and it integrates very well with Visual Studio 2008, allowing you to look at everything you are doing visually. You can always switch to the XAML view and modify your code manually, but this gives you a lot of control over animation.