unit unitmedia;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Media.Win,
FMX.Controls.Presentation, FMX.StdCtrls,mediaPLayerStretchFix,
FMX.Media, FMX.Objects;
type
Tplayer =
class(TForm)
OpenDialog1: TOpenDialog;
Button1: TButton;
MediaPlayer1: TMediaPlayer;
MediaPlayerControl1: TMediaPlayerControl;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure OpenDialog1Close(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
player: Tplayer;
implementation
{$R *.fmx}
procedure Tplayer.Button1Click(Sender: TObject);
var pfad:
String;
begin
pfad := '
D:\PROGRAMME\SEHTEST mit externen Bildern V3\Win32\Debug\Filme\';
OpenDialog1.InitialDir := pfad;
OpenDialog1.Execute;
end;
procedure Tplayer.Button2Click(Sender: TObject);
begin
MediaPlayer1.Play;
end;
procedure Tplayer.Button3Click(Sender: TObject);
begin
MediaPlayer1.Stop;
end;
procedure Tplayer.Button4Click(Sender: TObject);
begin
if (MediaPlayer1.State = TMediaState.Playing)
then
begin
TWindowsMedia(MediaPlayer1).stretch;
end;
end;
procedure Tplayer.OpenDialog1Close(Sender: TObject);
begin
MediaPlayer1.FileName := OpenDialog1.FileName;
end;
end.