How do I play movies in a C# WinForm application

空扰寡人 提交于 2019-12-03 08:55:11

I think this is probably the path of least resistance:

http://msdn.microsoft.com/en-us/library/bb383953.aspx

You could use Windows Media Player ActiveX control.

You could also embed a WPF control that contains a MediaElement control.

Another alternative is to use the VLC library instead of Windows Media Player. The VLC Forums have a number of wrappers that can be used in C#.

I have not done a comparison of VLC versus Windows Media Player, but it is alot less resource intensive then the WPF media elements.

If I remember correctly VLC also has built in support for alot of video formats, potentially making it a better choice I guess.

It depends on how complicated you want to get, but I've had luck implementing DirectShow before. It's definitely more complicated than a drop on control, but it's really flexible for different formats and loading codecs.

One possibility is to use the Forms.WebBrowser class. This will give you an embedded web browser so you can install what ever player and plugins you need.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!