实现avi全屏播放
【打印文章】
uses Unit2;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
Form2.WindowState := wsMaximized;
Form2.MediaPlayer1.Notify := false;
Form2.MediaPlayer1.Display := Form2.Panel1;
Form2.MediaPlayer1.FileName := 'C:\TheWall\DELCAR2.AVI';
Form2.MediaPlayer1.Open;
Form2.MediaPlayer1.DisplayRect := Form2.ClientRect;
Form2.MediaPlayer1.Play;
end;
{Code for Form 2}
procedure TForm2.MediaPlayer1Notify(Sender: TObject);
begin
if MediaPlayer1.NotifyValue = nvSuccessful then
Form2.Close;
end;
//////////////////////////////////////////////////////
public
{ Public-Deklarationen }
procedure MMNotify(var Message: TMessage); message MM_MCINOTIFY;
end;
var
Form1 : TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
mciSendString('open j:\video.avi alias film', nil, 0, 0);
mciSendString('window film handle 0', nil, 0, 0);
mciSendString('window film state show maximized', nil, 0, 0);
mciSendString('play film notify', nil, 0, Form1.Handle);
end;
procedure TForm1.MMNotify(var Message: TMessage);
begin
mciSendString('close film', nil, 0, 0);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
Form2.WindowState := wsMaximized;
Form2.MediaPlayer1.Notify := false;
Form2.MediaPlayer1.Display := Form2.Panel1;
Form2.MediaPlayer1.FileName := 'C:\TheWall\DELCAR2.AVI';
Form2.MediaPlayer1.Open;
Form2.MediaPlayer1.DisplayRect := Form2.ClientRect;
Form2.MediaPlayer1.Play;
end;
{Code for Form 2}
procedure TForm2.MediaPlayer1Notify(Sender: TObject);
begin
if MediaPlayer1.NotifyValue = nvSuccessful then
Form2.Close;
end;
//////////////////////////////////////////////////////
public
{ Public-Deklarationen }
procedure MMNotify(var Message: TMessage); message MM_MCINOTIFY;
end;
var
Form1 : TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
mciSendString('open j:\video.avi alias film', nil, 0, 0);
mciSendString('window film handle 0', nil, 0, 0);
mciSendString('window film state show maximized', nil, 0, 0);
mciSendString('play film notify', nil, 0, Form1.Handle);
end;
procedure TForm1.MMNotify(var Message: TMessage);
begin
mciSendString('close film', nil, 0, 0);
end;
本栏文章均来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。( Pfan.cn )
【编程爱好者论坛】