Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 .NET4
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
Comments
Sergey Alexandrovich Kryukov at 23-Sep-12 11:21am
   
And where is your question then?
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Your Google-fu needs work.
 

A lot of work...
 

Google: "add mediaplayer c#"[^]
  Permalink  
Rate this: bad
good
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:
 
axWindowsMediaPlayer1.Ctlcontrols.stop();
 
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";
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 231
1 CPallini 201
2 BillWoodruff 180
3 Maciej Los 165
4 Kornfeld Eliyahu Peter 160


Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 23 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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