Click here to Skip to main content
Sign Up to vote bad
good
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:57

Comments
Sergey Alexandrovich Kryukov - 23 Sep '12 - 11:21
And where is your question then? --SA

3 solutions

Your Google-fu needs work.
 

A lot of work...
 

Google: "add mediaplayer c#"[^]
  Permalink  
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  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 514
1 CPallini 245
2 Mahesh Bailwal 244
3 Maciej Los 240
4 Aarti Meswania 213
0 Sergey Alexandrovich Kryukov 9,162
1 OriginalGriff 7,179
2 CPallini 3,913
3 Rohan Leuva 3,176
4 Maciej Los 2,588


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 23 Sep 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid