/// <summary>
 /// Creates and plays a given media file within a given control.
 /// </summary>
 /// <param name="filename">The file you want to play.</param>
 /// <param name="parent">The control in which the media file should be rendered. (for videos)</param>
 /// <returns>A media object that represents the file you defined.</returns>
 /// <exception cref="MediaPlayerException"></exception>
 public static Media play(string filename, System.Windows.Forms.Control parent)
 {
     Media media = new Media(filename);
     media.play(parent);
     return media;
 }
        void mediaStateChanged(Media sender, Media.MediaEventArgs e)
        {
            Debug.WriteLine("New media state: " + e.NewState);

            updateGUI();
        }
 /// <summary>
 /// Creates and plays a given media file.
 /// </summary>
 /// <param name="filename">The file you want to play.</param>
 /// <returns>A media object that represents the file you defined.</returns>
 /// <exception cref="MediaPlayerException"></exception>
 public static Media play(string filename)
 {
     Media media = new Media(filename);
     media.play();
     return media;
 }
 private void btPlayMP3_Click(object sender, EventArgs e)
 {
     _lastMedia = MediaPlayer.play(tbMP3File.Text, mediaBox);
     propertyGrid1.SelectedObject = _lastMedia;
 }