RadControls for Silverlight

This article will show you how to create a simple MediaPlayer.

Note

In order to use RadMediaPlayer in your projects you have to add references to the following assemblies:

  • Telerik.Windows.Controls
  • Telerik.Windows.Controls.MediaPlayer

You can find more info here.

  1. Drag and Drop the MediaPlayer control from the toolbox.
  2. After you have dropped the control onto the design surface, you can modify it by setting various properties:
    CopyXAML
    xmlns:telerik=http://schemas.telerik.com/2008/xaml/presentation
    ...
    <telerik:RadMediaPlayer IsAutoPlaylistAdvance="True" MinWidth="200" SelectedIndex="0">
    </telerik:RadMediaPlayer>

The RadMediaPlayer control can be populated with items of type RadMediaItem. Each media item represents a resource (file or stream) that can be played by the RadMediaPlayer control. Below is an example demonstrating how to declaratively add an item in XAML:

CopyXAML
<telerik:RadMediaPlayer Width="600" Height="400" Margin="20">
    <telerik:RadMediaItem 
        Source="http://mschnlnine.vo.llnwd.net/d1/ch9/7/1/5/1/2/4/DynamicsDuoCRMSilverlight_ch9.wmv"
        Header="The Dynamics Duo talk about CRM and Silverlight" />
</telerik:RadMediaPlayer>