Click here to Skip to main content
13,559,528 members
Rate this:
Please Sign up or sign in to vote.
See more:
I wanted to play mp3 vedios in my c# project.. but I don't know the exact code of media player.. I have searched every where . but i have not found any code please help me and solve my problem..
Posted 23-Sep-12 2:57am
SAKryukov 23-Sep-12 11:21am
And where is your question then?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Your Google-fu needs work.

A lot of work...

Google: "add mediaplayer c#"[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

A) Check toolbox. If you can find Windows Media Player componet skip this step and continue. Else do the following:

1. Right-click within the Toolbox, and then select Choose Items. This opens the Customize Toolbox dialog box.

2. On the COM Components tab, select Windows Media Player.
If Windows Media Player does not appear in the list, click Browse, and then open Wmp.dll, which should be in the Windows\System32 folder.

3. Click OK. The Windows Media Player control will be placed on the current Toolbox tab.

B) Select Windows Media PLayer component from toolbox and add it to your form.

C) Select the Windows Media Player control in your form, then change the uiMode property to "none". This setting hides the UI controls. When the user plays a video, it will appear in the window.

D) Double Click the "Play" Button to see its code window.

E) Add below code to the event of play button:

axWindowsMediaPlayer1.URL = @"c:\mediafile.wmv";

Where "c:\mediafile.wmv" is a placeholder for the name of the media item you want to play.

F) And to add the stop code, double click on stop button and add the followinfg code:


No matter what type of file you want to play. You just need to set the url of windows media player component to your file. For example:

axWindowsMediaPlayer1.URL = @"c:\Music.mp3";

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180527.1 | Last Updated 23 Sep 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100