天天看點

C# 視訊播放控件 wmp、vlc、aplayer

1、Windows Media Player

C#學習之路WindowsMediaPlayer詳解- 知其是以然- CSDN部落格

2、vlc

自定義基于 VLC 的視訊播放器

how to use vlc.dotnet

// libvlc類庫+vlc.dotnet
// vlc官網:http://www.videolan.org/
// vlc下載下傳位址:
// http://get.videolan.org/vlc/3.0.7.1/win32/vlc-3.0.7.1-win32.exe
// http://get.videolan.org/vlc/3.0.7.1/win64/vlc-3.0.7.1-win64.exe

// 1、從安裝好的vlc中的 “libvlc.dll、libvlccore.dll和plugins目錄” 提取到debug目錄下
// 2、通過nuget引用vlc.dotnet
// 3、執行如下代碼
private Vlc.DotNet.Forms.VlcControl vlcControl = null;
public Form1()
{
    InitializeComponent();

    this.vlcControl = new Vlc.DotNet.Forms.VlcControl();
    this.vlcControl.BeginInit();
    // 一定要設定該屬性
    this.vlcControl.VlcLibDirectory = new DirectoryInfo(Environment.CurrentDirectory);
    this.vlcControl.EndInit();
    this.vlcControl.Dock = DockStyle.Fill;
    this.Controls.Add(this.vlcControl);
}
           

3、APlayer

C#使用APlayer開發自制媒體播放器

// APlayer官網:http://aplayer.open.xunlei.com/
// APlayer SDK:http://aplayer.open.xunlei.com/APlayerSDK.zip
// APlayer 完整解碼庫:http://aplayer.open.xunlei.com/codecs.zip
// 1、APlayer.dll為包含APlayer的ActiveX控件
// 2、需要增加解碼庫時,将解碼庫拷貝到C:\Users\Public\Thunder Network\APlayer\codecs目錄