Using ltmmPlayCtrl for Simple Playback (Delphi 6.0)
The ltmmPlayCtrl object allows the user to playback multimedia files. Using the following steps:
1. |
Start Delphi 6. | |
2. |
If you didn’t install LEAD Multi-Media controls before, install them. On the Component pull-down menu, use the Import ActiveX Control… and select the LEAD Multi-Media Library (14), and Press install, and then compile and install the package dclusr.dpk. | |
3. |
From the ActiveX controls tab; add the ltmmPlayCtrl to your form. Size and position the control, as you want it to appear at run time. | |
4. |
Add a button control to your form, and name it as follows: | |
|
Name |
Caption |
|
btnPlay |
Play |
5. |
Handle the Form1 OnCreate event, and code FormCreate procedure as follows: |
procedure TForm1.FormCreate(Sender: TObject);
begin
// Set the Source File
ltmmPlayCtrl1.SourceFile:= 'c:\source.avi';
end;
6. |
Handle the btnPlay OnClick event, and code btnPlayClick procedure as follows: |
procedure TForm1.btnPlayClick(Sender: TObject);
begin
ltmmPlayCtrl1.Run ( );
end;
7. |
Run your program to test it. |