video player
Posted: Sat Nov 29, 2008 11:00 pm
why would this delphi code raise an execution error "GetFrameOpen AVE file stream" -- the file referenced plays using a tanimate with simply
Animate1.FileName := edit1.text;
also, I have sucessfully used video create in another op.
Thank you.
Animate1.FileName := edit1.text;
also, I have sucessfully used video create in another op.
Thank you.
Code: Select all
unit video2;
{$I TeeDefs.inc}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
TeEngine, Series, TeeProcs, Chart, TeeTools, TeeVideoPlayer,
ExtCtrls, StdCtrls, Buttons, BubbleCh;
type
Tvideo2f = class(TForm)
bstart: TBitBtn;
bstop: TBitBtn;
Chart1: TChart;
Edit1: TEdit;
Series1: TBubbleSeries;
procedure FormCreate(Sender: TObject);
procedure bstartClick(Sender: TObject);
procedure bstopClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
VideoPlayer : TVideoPlayerTool;
deltarotate:integer;
public
{ Public declarations }
end;
var
video2f: Tvideo2f;
implementation
{$R *.DFM}
procedure Tvideo2f.FormCreate(Sender: TObject);
begin
DeltaRotate:=-5;
Chart1.Width:=160; //640;
Chart1.Height:=120; //480;
Chart1.View3D:=true;
VideoPlayer:=TVideoPlayerTool.Create(Self);
with VideoPlayer do
begin
ParentChart:=Chart1;
FileName:=edit1.Text;
Loop:=True;
end;
end;
procedure Tvideo2f.bstartClick(Sender: TObject);
begin
if FileExists(edit1.Text) then
begin
VideoPlayer.Play;
Bstart.Enabled:=False;
BStop.Enabled:=True;
end
else
ShowMessage('File ' + VideoPlayer.FileName + ' not found.');
end;
procedure Tvideo2f.bstopClick(Sender: TObject);
begin
VideoPlayer.Stop;
Bstart.Enabled:=True;
BStop.Enabled:=False;
end;
procedure Tvideo2f.FormDestroy(Sender: TObject);
begin
VideoPlayer.Free;
end;
end.