Delphi Activex Trackbar

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
andydyble
New Cone
New Cone
Posts: 5
Joined: 19 Nov 2007 15:13

Delphi Activex Trackbar

Postby andydyble » 28 May 2008 18:26

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;

Chuen
Blank Cone
Blank Cone
Posts: 49
Joined: 19 Sep 2008 04:40
Contact:

Re: Delphi Activex Trackbar

Postby Chuen » 20 Sep 2008 03:04

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
Regards
Chuen

mortechsystems
Blank Cone
Blank Cone
Posts: 16
Joined: 03 Sep 2009 16:32

Re: what have I done wrong here

Postby mortechsystems » 03 Sep 2009 16:41

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

mortechsystems
Blank Cone
Blank Cone
Posts: 16
Joined: 03 Sep 2009 16:32

Re: Delphi Activex Trackbar

Postby mortechsystems » 04 Sep 2009 05:04

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.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 38 guests