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


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 ! >
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

sneeuwAuthor Commented:
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 ?
sneeuwAuthor Commented:
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.

sneeuwAuthor Commented:
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)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.