How to use TMediaPlayer for playing mpg in memory rather then via filename

sneeuw used Ask the Experts™

I use Borland C++ Builder 4.

I want to play a MediaFile with NO filename.
E.g.  Now, the component runs when a Filename is delivered via a String object.

I'd like (if possible) to play from memory ???
Is that possible ??
If yes ... How ???

< More points can be earned since I already have 200 points 'for grabs' in the C++ group ! >
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

what do you want to play? avi, wav?
I dont think it is possible to do this.  MediaPlayer doesn't support memory streams.

If you are using AVIs, then there are plenty of components around which will allow you to use memory streams.

JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.


I was thinking of playing mpg streams from memory !!!!
No components around that allow that ?
Not possible ... I think !!!

Why would you want to do this any way ?


Well ...

I am creating a little program that interprets the file system of CD-i (amongst other things, e.g. not finalised CDs, first session ...).

It would be nice if I could play the mpg of CD-i movies without having to copy the mpg to HD first.
I realise there are possibilities such as creating a Windows driver (so that Windows does it for you), but that is not my intention.

So, that's why.
It would be nice to have this as an extra options in my program with as little effort as possible (that's why I was thinking of using the TMediaPlayer Component).

But ...
If not possible ...
I'll leave it out !
No.  It is totally impossible using the TMediaPlayer component.  It does not support memory streaming at all, regardless of file type.

However, if you already have access to the file on the CD, why can't you just play it straight off the CD?  I don't get why you have to copy it too the hard drive first?  Maybe I have over looked something here, I don't know, but I am not really following what you want to do.



I cannot play directly from CD because Windows does not see the files (as I mentioned before).  I do it (or rather my app interprets the file structure on the CD), but because I am not writing a driver, I cannot tell Windows what is located where.

And what if I inherit from the TMediaPlayer component ??
Can I acces the source code for that component in Builder 4 (Enterprise edition) and how ??
Maybe files are handled via the TFileStream component ... ???
What if I create something with a TMemoryStream component instead ??

Any thoughts on this ??
Sorry my friend, but this is beyond my experiences.  You could inherit the TMediaPlayer and give it memory streaming support I guess.  How, I honestly do not know.


Can't be done cause the TMediaPlayer used MCI commands and all.
NOT TMemorySTream.
(E.g. see Alex' answer on same question in C++ group)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial