procedure
TMainForm
.
FormCreate(Sender: TObject);
var
err :
integer
;
args:
array
[
0..1
]
of
pchar
;
val
:TValue;
begin
err:=VLD_Startup;
if
err<>VLD_SUCCESS
then
begin
case
err
of
VLD_NOTFOUND: ShowMessage(
'Библеотека повреждена либо не верная версия!'
);
VLD_NOLIB : ShowMessage(
'Не найдена необходимая библиотека!'
);
end
;
Application
.
Terminate;
exit;
end
;
vlc:=call(
'VLC_Create'
,VLC_Create);
args[
0
]:=
pchar
(VLD_LibPath);
args[
1
]:=
nil
;
call(
'VLC_Init'
,VLC_Init(vlc,
1
,@args[
0
]));
val
.
AsInteger:=Panelka
.
Width;
call(
'VLC_VariableSet'
,VLC_VariableSet(vlc,
'conf::width'
,
val
));
val
.
AsInteger:=Panelka
.
Height;
call(
'VLC_VariableSet'
,VLC_VariableSet(vlc,
'conf::height'
,
val
));
val
.
AsInteger:=Panelka
.
Handle;
call(
'VLC_VariableSet'
,VLC_VariableSet(vlc,
'drawable'
,
val
));
Caption:=Caption+
' [engine-0.14]'
;
end
;
<b>и собственно процедура проигрывания</b>
procedure
TMainForm
.
Image2Click(Sender: TObject);
var
link:
string
;
begin
call(
'VLC_AddTarget'
,VLC_AddTarget(vlc,
PChar
(link),
nil
,
0
,PLAYLIST_APPEND,PLAYLIST_END));
VLC_Play(vlc);
end
;