寻找一个组件(.NET或COM / ActiveX技术),可以在一个WinForms应用程序播放AVI文件应用程序、组件、文件、技术

2023-09-04 00:50:41 作者:梦在深巷。

我在寻找的东西,如Windows媒体播放器控件,可以在窗体上托管。

I'm looking for something like the Windows Media Player control that can be hosted on a form.

在WMP不适合我,因为我需要一个控制,可以按顺序播放的AVI文件连续-附加播放列表,这样,从一个文件到下一个的转变发生无缝(即没有任何故障或暂停的视频和音频)。随着WMP,总有半秒的文件或使之间的延迟。

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.

有谁知道一个控制(它可以为商业或开源的),可以做到这一点的?我认为这样的事包的DirectX,而这也没关系。

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.

推荐答案

您可以尝试的DirectX SDK从微软的.Net:下载

You might try the DirectX SDK from Microsoft for .Net: download

它包含了AudioVideoPlayback namepsace与视频类,很容易在任何.NET项目中使用。您的视频类绑定到一个Panel控件是这样的:

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;
}

视频类包含了几种回放像播放,暂停,停止,当然FROMFILE和。

The video class contains several methods for playback like Play, Pause, Stop and of course FromFile.

文件和使用C#中的AudioVideoPlayback命名空间的例子:

Documentation and examples of using the AudioVideoPlayback namespace in C#:

AudioVideoPlayback API 视频类(Microsoft.DirectX.AudioVideoPlayback) AudioVideoPlayback API Video Class (Microsoft.DirectX.AudioVideoPlayback)

使用这些MSDN的文章和我的样本code以上,你应该能够显示视频和扩展类在播放列表中播放多个视频。

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.