views:

249

answers:

1

I have a C# app, and I'm looking at using the Windows Media Player COM control to play animation and audio. So far, the only way I see of programatically controlling what the control is playing is to set its URL property to point to some file (I assume there's some way to pass in a playlist).

Is there any way the WMP can render an AVI that is entirely in-memory, like a MemoryStream or something? If so, can WMP skip from one AVI to the next seamlessly (i.e. no glitch in either the audio or the video as it transitions from one to the next)?

If WMP only plays files, is there some way to cue up a list of the files in advance of play start? If so, can WMP be made to skip from one file to the next without a brief interruption?

Any knowledge or links to knowledge would be much appreciated.

Edit: alternatively, are there any third-party controls that can do this? To clarify, what I really need is a control that will play a sequence of AVI files (either in-memory or from disk) and play both the video and audio seamlessly as it transitions from one file to the next (so there are no slight glitches or pauses between files). WMP seems to shut the audio engine off and then back on between each file (which results in a tiny "pop" noise), so I'm not really even sure WMP can do what I need.

Edit 2: never mind. I just tried splitting an AVI file and then playing the segments consecutively in a play list, and it's much worse than a tiny "pop" noise. It pauses for almost a second. I don't think WMP is built to do what I need it to do.

+1  A: 

I really hope this isn't the answer:

DirectShow and Windows Media Player allow a URL instead of a filename to play a video. You could create a thread in your app that listens on a dynamic socket for HTTP requests on the loopback adapter (127.0.0.1) and only takes requests from your app (look in the header or put something in the url that identifies the request). Then you could read the resource into memory and feed it back through the web request.

-from Bill Reiss MVP

Found at:

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5ffb0aa2-d2b3-44d0-985c-f1d3034711b5

Is this remotely possible?

MusiGenesis
+1 very creative answer!
Preet Sangha
I hope someone tells me there's no way that would work, so I don't waste any time trying it. It would be a heckuva hack if it did. :)
MusiGenesis