Windows Phone 7 -Silverlight & Media

This article covers the various ways you can integrate media into your Windows Phone application. You will see what great support for media formats is included with Windows Phone and how easy it is to play media files using the included Silverlight controls. In addition, you will see how to consume video sources from third-party websites such as YouTube, and you will learn how to give users the ability to play that media right from your own application.

With Silverlight, developers can concentrate on one set of APIs that in most cases they were already familiar with from Silverlight development on the web. Because Microsoft also announced specific hardware requirements for Windows Phone, developers can finally write a solution without worrying about a myriad of device-specific issues.

Included with the Silverlight platform for Windows Phone are powerful media capabilities that developers can use. With the new programming interface, you can write media-rich applications that take advantage of third-party web services, streaming media, just about every popular media code, the popular Zune software interface, and you even have easy access to an FM radio and built-in microphone. This article takes you through all of the media features on the Windows Phone platform that are at your disposal, ending with a full step-by-step tutorial showing how to create a rich-media player application that is integrated with the main Music + Video Hub on the phone.

This article is for .NET and Silverlight developers who are already familiar with the basics of the Windows Phone Platform. Readers should also have a solid grasp of the latest C# programming concepts. Readers do not need to be familiar with the media aspects of the Silverlight for Windows Phone platform.

To get the most out of this article, you should have the latest version of the Windows Phone developer tools installed. These tools are required regardless of which version of Visual Studio 2010 you have installed and are available from the App Hub at These free tools include the express version of Visual Studio 2010 and Expression Blend for Windows Phone. If you already have a full version of Visual Studio 2010, that works as well. To create the web service used in the final example in the article, you will also need either the full edition of Visual Studio 2010 or Visual Web Developer Express 2010.

You should also download and install the Google Data API for .NET, available from This .NET based toolkit will be utilized to create a custom YouTube video searching application. Although not required, it would be helpful to have a Windows Phone device at your disposal because some of the examples can be tested and debugged only when an actual hardware device is connected to the PC. For this article, the Samsung Focus was used when testing against a physical Windows Phone device.