views:

67

answers:

1

I'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.

+1  A: 

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#:

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.

Webleeuw
I guess that's the way to go, since most of these components seem to be wrapping that anyway. I'm just afraid that since none of the commercial components I've looked at can do this, it might be the case that DirectX can't do this, for some reason.
MusiGenesis
Another possibility is of course WPF, but of course thats quite another technology then WinForms
Webleeuw
@Webleeuw: I've found a few posts that suggest the 3.5 and earlier version of MediaElement is buggy (don't know this myself), and anyway I'm not sure the MediaElement does exactly what I need (the seamless transition thing).
MusiGenesis
Well, I downloaded the SDK, but it doesn't contain an C# samples (only C++). Do you have any links to sample C# project that use this?
MusiGenesis
Do you know if the AudioVideoPlayback API is ultimately wrapping DirectShow (or if they're both wrappers around the same thing)? I've made some progress with DirectShow since yesterday, and I'm able to transition between videos with almost (but not quite) no noticeable gap. It looks like the source of the problem is a slight variable delay in the actual starting of the file. I'll take a look at the AVP links and see if they're subject to the same problem; thanks for adding them.
MusiGenesis