Playing Res Avi's

I have an Avi file compiled with my exe, so how can I play it with the tmediaplayer, or should I use something else?
LVL 1
bogieman_Asked:
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.

craig_capelCommented:
Put a mediaplayer button on (long strip of coloured buttons) inside the system bit.

You set autoopen:=true in the properties
set the device type to  dtAVIVideo
then set the filename (still all in the properties) to your avi, for example c:\myavi.avi

And then you run your program


Hope that helps

Craig C.

http://members.xoom.com/craig_c/
0
rwilson032697Commented:
You would do it like this:

(Assuming the RC.and RES files are built like this)

       Here is my RC file (files.rc):
       FILE1   DATA    "C:\Temp\File1.avi"

       In your main form, include the following:
       {$R Files.res}

       Here is the code to extract it:

       var
         rs: TResourceStream;
       begin
         rs := TResourceStream.Create(hInstance, PChar('File1'),
PChar('Data'));
         try
           rs.SaveToFile(Test.avi');
         finally
           rs.Free;
         end;
       end;

Then you just play the AVI from the file as normal.

Cheers,

Raymond.
0
IndefreiCommented:

to play you gonna use

     Mediaplayer1.Display :=Panel1;
     Mediaplayer1.autoOpen := True;

     MediaPlayer1.FileName := 'J:\Daten\Avi\Bhutan1.avi';
     Mediaplayer1.autoOpen := true;
     mediaplayer1.open;
     Panel1.Width := MediaPlayer1.DisplayRect.Right;
     Panel1.Height := MediaPlayer1.DisplayRect.Bottom;
     Panel1.Left :=  10; // any const
     Panel1.Top  :=  10; // any const
     mediaplayer1.play;
cheers
Indi
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

IndefreiCommented:
Oops, autoopen is twice
sorry
0
bogieman_Author Commented:
Do I have to save the AVI to a file before I can play it, or can I play it straight from the EXE?? I will accept your answer if thats the only way.
0
rwilson032697Commented:
That is the only way I'm afraid!

Cheers,

Raymond.
0

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
bogieman_Author Commented:
Well - I've just found a component to play Gif's straight from the exe, and you can convert AVI's to GIF's - so this is not really any use to me but you answered the question, so take the points.
0
bogieman_Author Commented:
How the hell do you people manage to get 180821 points!!??  Do you spend your whole lives in this place?

Anyway, thanks for the answer - I don't need to even use it anymore but what the hey!
0
rwilson032697Commented:
It took a while... ;-)

Cheers,

Raymond.
0
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
Delphi

From novice to tech pro — start learning today.