Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble showing Mpeg in window

Status
Not open for further replies.

jjschwartz

Technical User
Feb 3, 2004
23
US
I'm trying to show an Mpeg in an TEdit control on my form.

My basic code is;

Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
MediaPlayer1.FileName := movie.mpeg;
MediaPlayer1.Open;
MediaPlayer1.Wait := false;
MediaPlayer1.Play;
end;

where I've set the MediaPlayer1.Display property to the Tedit control.

If I do this, the Mpeg briefly flashes maybe one frame and disappears.

If I set the MediaPlayer1.Display property to nil, the Mpeg plays successfully in its own window.

If I set the MediaPlayer1.Wait property to true, the mpeg plays successfully in the TEdit.

If I try to play an .avi instead of the .mpeg, while the Wait property is false, it plays successfully in the TEdit.

Any advice on getting the Mpeg to play in the TEdit with Wait=false? (I want to handle some events while movie is playing.) Any insights into why the .avi is working while the .mpeg is not?

TIA,
Jeff Schwartz
 
Curiously, if I set the MediaPlayer to display in a TPanel, it works fine.

It's a problem only for an MPEG, with Wait=false, in a TEdit or TStaticText or TButton (at least that's all I've tried).

I've rewritten my code to include a TPanel but I sure would like to understand why this happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top