AUTHOR: Desislava Yordanova
DATE MODIFIED : March 19, 2018
DATE POSTED: November 13, 2017
A common question that we see from our Windows Forms customers is how to play video files in their WinForms applications. This article aims to answer this question by providing guidance on some of the possible means to achieve this.
In order to play multimedia in your WinForms application there is a plenty of options. We will pay attention to the most widely spread and easy to achieve approaches.
Let’s start with an approach which is already available with Windows and the Windows Forms development environment. This is how to embed the Windows Media Player in your application through the Toolbox in Visual Studio. Please follow the steps below:
Thus, the Windows Media Player will be added as an AxWindowsMediaPlayer object to your form and you can add it as any other control from the Toolbox. Set the URL property to specify the name of the clip to play. Then, just run the application and click the Play button. The Ctlcontrols property gets an IWMPControls interface that provides a way to manipulate the playback of a media item. All supported file types are listed here.
VLC is a very popular, multiplatform, open-source media player that can read a wide range of media. All of its features are available to application developers thanks to the LibVLC framework. Vlc.DotNet is a .NET wrapper around LibVLC which hosts the audio/video capabilities of the VLC libraries. It runs on any .NET version starting from .NET 2.0 and can be easily integrated in WinForms. Here are the steps that you need to perform in order to integrate the VLC player in your WinForms application:
sender, Vlc.DotNet.Forms.VlcLibDirectoryNeededEventArgs e)
(IntPtr.Size == 4)
FileInfo fi =
You can refer to the public repository at the following link: https://github.com/ZeBobo5/Vlc.DotNet/blob/develop/README.md. All supported formats by VLC are listed here.
The attached zip file provides a sample application with two projects: one that demonstrates how to embed the Windows Media Player and another that shows how to use the open-source Vlc.DotNet.