Book Image

MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide

By : Johnny Tordgeman
Book Image

MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide

By: Johnny Tordgeman

Overview of this book

Microsoft Silverlight is a powerful development platform for creating engaging, interactive applications for many screens across the Web, desktop, and mobile devices. Silverlight is also a great (and growing) Line-Of-Business platform and is increasingly being used to build data-driven business applications. Silverlight is based on familiar .NET languages such as C# which enables existing .NET developers to get started developing rich internet applications almost immediately. "MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide" will show you how to prepare for and pass the (70-506): TS: Microsoft Silverlight 4 Development exam.Packed with practical examples and Q&As, MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide starts by showing you how to lay out a user interface, enhance the user interface, implement application logic, work with data and interact with a host platform amongst others.
Table of Contents (15 chapters)
MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Playing media files


The final subject we will discuss in this chapter is the media capabilities of Silverlight. As it was first introduced, Silverlight was always a media-focused framework. Silverlight has the ability to play audio and video files (HD content), stream media, and use Digital Rights Management (DRM) to protect the displayed media. The heart of all of these is the MediaElement control.

The MediaElement control

The MediaElement control is a rectangular control that can contain audio or video as its content. Silverlight supports many codes for audio and video and a full list of supported codecs can be found on the MSDN website—http://msdn.microsoft.com/en-us/library/cc189080%28v=vs.95%29.aspx.

Using the MediaElement control is quite straightforward. Create a new Silverlight project in Visual Studio and name it Chapter2-Media. Copy a video file to your web project ClientBin directory (you can find a few in Windows 7 operating system's Sample Videos folder), and copy the following...