Looking for a component (.NET or COM/ActiveX) that can play AVI files in a WinForms app [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this questionI'm looking for something like the Windows Media Player control that can be hosted on a form.
The WMP doesn't work for me because I need a control that can play a continuously-appended playlist of AVI files in sequence, so that the transition from one file to the next happens seamlessly (i.e. without any glitches or pauses in the video and audio). With WMP, there's always a delay between files of half a second or so.
Does anyone know of a control (it can be either commercial or open-source) that can do this? I开发者_运维问答 assume anything like this wraps DirectX, and that's OK too.
You might try the DirectX SDK from Microsoft for .Net: download
It contains a AudioVideoPlayback namepsace with the Video class that is easy to use in any .Net project. You bind the Video class to a Panel control like this:
Video video;
public Form1(string[] args) {
InitializeComponent();
video = new Video(dialog.FileName);
video.Owner = panel1;
}
The video class contains several methods for playback like Play, Pause, Stop and of course FromFile.
Documentation and examples of using the AudioVideoPlayback namespace in C#:
- AudioVideoPlayback API
- Video Class (Microsoft.DirectX.AudioVideoPlayback)
With these MSDN articles and my sample code above you should be able to display a video and extend your class to play multiple videos in a playlist.
精彩评论