unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MPlayer, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
MediaPlayer1: TMediaPlayer;
OpenDialog1: TOpenDialog;
Button2: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
with MediaPlayer1do
begin
if OpenDialog1.Execute then
begin
FileName:=OpenDialog1.FileName;
Open;
Play;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
MediaPlayer1.Pause;
end;
end.