ComponentOne MediaPlayer for WPF and Silverlight
Silverlight Quick Start / Step 2 of 3: Adding Content to the C1MediaPlayer Control
In This Topic
    Step 2 of 3: Adding Content to the C1MediaPlayer Control
    In This Topic

    In this section of the quick start tutorial, you will add a video with one chapter to the C1MediaPlayer control.

    Complete the following steps:

    1. Add video content to the C1MediaPlayer control by placing the following XAML markup between the <c1mediaplayer:C1MediaPlayer> and </c1mediaplayer:C1MediaPlayer> tags:

      XAML
      Copy Code
      <c1mediaplayer:C1MediaItem MediaSource="http://download.componentone.com/pub/Videos/Trevor%20Does%20Silverlight.wmv"></c1mediaplayer:C1MediaItem>
      

       

    2. Add a title to the video by adding Title="Trevor Does Silverlight" to the <c1mediaplayer:C1MediaItem> tag so that the markup resembles the following:
      C#
      Copy Code
      <c1mediaplayer:C1MediaItem MediaSource=http://download.componentone.com/pub/Videos/Trevor%20Does%20Silverlight.wmv Title="Trevor Does Silverlight">   
      

       

    3. Set the C1MediaItem.NaturalDuration property to 28 minutes and 15 seconds by adding NaturalDuration="00:28:15" to the <c1mediaplayer:C1MediaItem> tag so that the markup resembles the following:
      XAML
      Copy Code
      <c1mediaplayer:C1MediaItem MediaSource="http://download.componentone.com/pub/Videos/Trevor%20Does%20Silverlight.wmv" Title="Trevor Does Silverlight" NaturalDuration="00:28:15">
      

       

      The NaturalDuration property sets the duration time that will be shown when a user brings up the item list.

    4. Add a chapter to the video content by placing the following XAML markup between the <c1mediaplayer:C1MediaItem> and </c1mediaplayer:C1MediaItem> tags:        
      <c1mediaplayer:C1MediaChapter></c1mediaplayer:C1MediaChapter>
      
    5. Specify the positioning of your chapter by adding Position="00:02:48" to the <c1mediaplayer:C1MediaChapter> tag so that the markup resembles the following:        
      <c1mediaplayer:C1MediaChapter Position="00:02:48">
      
    6. Create a title for your chapter by adding Title="Setting Up a Development System" to the <c1mediaplayer:C1MediaChapter> tag so that the markup resembles the following:
      <c1mediaplayer:C1MediaChapter Position="00:02:48" Title="Setting up a Development System">
      

    You have successfully added a video with one chapter to the C1MediaPlayer control. In the next step, you will run the project and observe several functions of the C1MediaPlayer control.