Add a MediaPlayer(MediaPlayer1) to a form (named Form1), and also create a new
Form( as Form2, without border,and set to MAX Size ).
MediaPlayer1.FileName:='';
MediaPlayer.DisplayRect:=Form2.ClientRect;
......
....................
..
procedure TForm1.Timer1Timer(Sender: TObject);
begin
// Caption := TimeToStr(now);
if MediaPlayer1.Mode = MpPlaying then
begin
MediaPlayer1.TimeFormat := TFmilliSeconds;
TrackBar1.Max := MediaPlayer1.Length div 1000;
TrackBar1.Position := MediaPlayer1.Position div 1000;
if Form2.WindowState = wsMaximized then
Screen.Cursor := crNone {全屏幕播放时隐藏鼠标}
else
Screen.Cursor := crArrow;
end;
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
procedure TForm1.N_OpenFileClick(Sender: TObject);
begin
OpenDialog1.Title := '请选择视频文件';
OpenDialog1.Filter := '视频文件(*.mpg;*.mpeg;*.dat;*.avi)|*.mpg;*.mpeg;*.dat;*.avi|所有文件[*.*]|*.*';
if OpenDialog1.Execute then