VS2010下 VLC axvlc.dll 使用

Sample

http://dmediaplayer.codeplex.com/

Source code

http://dmediaplayer.codeplex.com/SourceControl/list/changesets

Steps

I now did the following: 
1. Installed VLC Media Player 1.1.7 The Luggage
2. Registered the ActiveX component:
regsvr32 "C:\Program Files\VideoLAN\VLC\axvlc.dll" axvlc.dll 是VLC的ActiveX库
3. Created a WinForm project in VS2010 (any other version >= 2005 should do too)
4. Toolbox/Choose item -> select COM register -> check "VideoLan VLC Plugin V2"
5. Drag item onto form
6. Add two buttons to form (Play & Stop)
7. Add the following code:
 

public partial class Form1 : Form
   {
       public Form1()
       {
           InitializeComponent();
           axVLC.AutoPlay =false;
           axVLC.playlist.add(@"D:\Data\Media\Filme\Drachenzaehmen\Drachenzaehmen.avi");
       }
 
       private void button1_Click(object sender, EventArgs e)
       {
           axVLC.playlist.playItem(0);
       }
 
       private void button2_Click(object sender, EventArgs e)
       {
           axVLC.playlist.stop();
       }
   }


猜你喜欢

转载自blog.csdn.net/willdomequer/article/details/19906169