ComponentOne MediaPlayer for WPF and Silverlight
Turning Off Autoplay
C1MediaPlayer Task-Based Help > Turning Off Autoplay

By default, the C1MediaPlayer control will autoplay audio files; however, you can turn this feature off by setting the C1MediaPlayer.AutoPlay property to False.

At Design Time

To turn off autoplay, complete the following steps:

  1. Click the C1MediaPlayer control once to select it.
  2. In the Properties window (or Properties panel in Blend), locate the AutoPlay check box and deselect it. 

In XAML

To turn off autoplay, add AutoPlay="False" to the <c1mediaplayer:C1MediaPlayer> tag so that the markup resembles the following:

<c1mediaplayer:C1MediaPlayer Name="C1MediaPlayer1" AutoPlay="False">

In Code

To turn off autoplay, complete the following steps:

  1. Open the Window1.xaml.cs page.
  2. Add x:Name="C1MediaPlayer1" to the <c1ext:C1MediaPlayer> tag so that the control will have a unique identifier for you to call in code.
  3. Place the following code beneath the InitializeComponent() method:

    Visual Basic
    Copy Code
    C1MediaPlayer1.AutoPlay = False
    

     

    C#
    Copy Code
    c1MediaPlayer1.AutoPlay = false;
    

     

  4. Run the program.