Page 1 of 1

Delphi Activex Trackbar

Posted: 28 May 2008 18:26
by andydyble
Hi

Anyone know how to link a trackbar to VLC player in delphi ? We use this code below to succesfully play DVD's.
I am not sure at what point to get the Length, because DVD's have menus(ifo files), so we have to get the length from the current chapter.

Thanks
Andy

procedure TfmMainVLC.Button6Click(Sender: TObject);
var
Reg: TRegistry;
options : variant;

begin
blVLCPluginFound := false;
// Is VLC ActiveX Plugin installed on this PC?
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKeyReadOnly('\Software\Classes\VideoLAN.VLCPlugin.1\') then begin
blVLCPluginFound := true;
end;
finally
FreeAndNil(Reg);
end;

if blVLCPluginFound then begin
VLCPlugin1 := TVLCPlugin.Create(Self);

VLCPlugin1.Parent := Self; // Means: Place the VLC-Player into Form1
VLCPlugin1.Width := 400;
VLCPlugin1.Height := 300;
VLCPlugin1.Top := 10;
VLCPlugin1.Left := 10;
VLCPlugin1.Show;
options := ':snapshot-path=d:\snapshots\12345.jpg';
VLCPlugin1.addTarget('V:', Options, VLCPlayListInsert, 0);
VLCPlugin1.play;
end else begin
ShowMessage('I am really sorry, but VLC (or its ActiveX Plugin) is currently not installed on this PC!');
end;

end;

Re: Delphi Activex Trackbar

Posted: 20 Sep 2008 03:04
by Chuen
Hi,

Your post is quite dated and I am not sure if you have solved the problem but if not here's an idea.

Components to use

Code: Select all

slider: TTrackBar; timer1: TTimer;
On Timer event:

Code: Select all

slider.Max := vlc.Length; ... slider.Position := vlc.Time;
Regards
Chuen

Re: what have I done wrong here

Posted: 03 Sep 2009 16:41
by mortechsystems
Thankyou to the clever person who created this originally
What have I done wrong.

if blVLCPluginFound then begin
VLCPlugin1 := TVLCPlugin.Create(Self);
VLCPlugin1.Parent := Self; // Means: Place the VLC-Player into Form1
VLCPlugin1.Width := 1024;
VLCPlugin1.Height := 768;
VLCPlugin1.Top := 50;
VLCPlugin1.Left := 50;
VLCPlugin1.Show;
VLCPlugin1.addTarget('dvb-t://frequency=191625000 :dvb-bandwidth=7', null, VLCPlayListInsert, 0);
// you can use any MRL with parameters instead of 'c:\video.mpg' here
VLCPlugin1.play;

Note the bold area
It works drirectlu in vlc anf I get video.
why not in delphi 2007
the video playback area loads. no tv

Cheers to all
David

Re: Delphi Activex Trackbar

Posted: 04 Sep 2009 05:04
by mortechsystems
I might have found the answer myself

VLCPlugin1.addTarget('dvb-t://frequency=191625000 :dvb-bandwidth=7000', null,

The dvb-bandwidth is express in hertz not MHz
So three 0's required.
I will try when I get home.