@Renato_souza_delphi, explaining in a very simple way what I had mentioned in the other answer.
In Delphi in the menu bar go to:
- Component / Import / Component.
- On the next screen choose the option Import Activex Control.
in the next screen locate in the grid:
Select the palette name as you wish I left it as ActiveX
.
- On the next screen choose the option Install To New Package and finish.
- Then check that the component palette you defined earlier was created in Delphi ( step 4 ).
- Put in the Form the component
TWindowsMediaPlayer
of this new palette and a Timer
setting it up as long as you want.
Go on the property of TWindowsMediaPlayer
and adjust your property Align
: alClient
.
Follow the code below with a simple implementation, in the line of code containing FLista.Add('arquivo.png')
replace the string containing the path of the files you want to present.
Implementation
unit frmPrincipal;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.OleCtrls, WMPLib_TLB, Vcl.StdCtrls,
Vcl.ExtCtrls;
type
TForm1 = class(TForm)
wm: TWindowsMediaPlayer;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
FIndex: Integer;
FLista: TStringList;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
FLista := TStringList.Create;
FIndex := 0;
FLista.Add('arquivo.png');
Flista.Add('arquivo.mp3');
Timer1.Enabled := True;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FreeAndNil( FLista );
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if FIndex > 1 then
Exit;
wm.URL := FLista.Strings[FIndex];
wm.controls.play;
Inc(FIndex);
end;
end.
This is a simple example of what you can easily do with the Activex
windows media player, there are numerous methods and features that you can implement any doubt is just talk, I could not detail and write a consistent code for lack of time but I hope you have caught the idea.
@Renato_souza_delphi, I will post the code on the weekend.
– Wellington Silva Ribeiro