VLC 0.9.2 : Delphi Wrapper
Posted: 12 Sep 2008 12:26
Hello !
I use libvlc.dll in my Delphi Application.
I did a unit libvlc.pas using the new API libvlc.dll and a second unit TFPPlayer.pas.
I can play, add options like goom or other, all work fine !!
But i've tried to play playlist since 2 days... but Dll just add to the media list the first media object and not the others !!
I do like this (where the filename is a m3u with several items, readable with VLC) :
Just the first media item from the m3u is added..not the others...(and there is no error)
Can someone help me ??
(i know that the playlist function is DEPRECATED so i try to use media list...)
(I will make my Delphi wrapper available when i will have finsh it)
( PS : Excuse me for my englis, but I'm a French developper : http://tfptools.free.fr )
Thanks a lot !
Keypad
I use libvlc.dll in my Delphi Application.
I did a unit libvlc.pas using the new API libvlc.dll and a second unit TFPPlayer.pas.
I can play, add options like goom or other, all work fine !!
But i've tried to play playlist since 2 days... but Dll just add to the media list the first media object and not the others !!
I do like this (where the filename is a m3u with several items, readable with VLC) :
Code: Select all
constructor TTFPPlayer.Create(AOwner: TComponent);
var
Args: array [0..1] of PChar;
val:TValue;
begin
inherited Create(AOwner);
VLC := nil;
VLCInput := nil;
Media := nil;
MediaPlayer := nil;
FIsPlaying := False;
ParentColor := False;
Color := clBlack;
Width := 320;
Height := 240;
Caption := '';
BevelOuter := bvNone;
case VLD_Startup of
VLD_SUCCESS :
begin
end;
VLD_NOLIB :
begin
raise TEVLCLoadLibrary.Create('VLC Player non installé!');
exit;
end;
VLD_NOTFOUND :
begin
raise TEVLCNotFound.Create('VLC Player non installé ou mauvaise version!');
exit;
end;
end;
//On efface les erreurs
FillChar(VLCError,SizeOf(VLCError),0);
//On crée une instance de VLC
Args[0] := PChar(VLD_LibPath);
Args[1] := nil;
VLC := libvlc_new( 1, @Args[0], VLCError);
// on crée un timer
FTimer := TTimer.Create(nil);
FTimer.Enabled := False;
FTimer.Interval := 500;
FTimer.OnTimer := FTimerTimer;
end;
procedure TTFPPlayer.Playlist_play(filename : pchar);
begin
libvlc_video_set_parent(VLC, Self.Handle, VLCError);
CheckError;
medialist := libvlc_media_list_new(vlc, vlcerror);
checkerror;
libvlc_media_list_add_file_content(medialist, filename,vlcerror);
checkerror;
Medialistplayer := libvlc_media_list_player_new(vlc, vlcerror);
checkerror;
MediaPlayer := libvlc_media_player_new(vlc,vlcerror);
checkerror;
libvlc_media_list_player_set_media_list(Medialistplayer, medialist, vlcerror);
checkerror;
libvlc_media_list_player_set_media_player(Medialistplayer,mediaplayer,vlcerror);
checkerror;
libvlc_media_list_player_play(Medialistplayer, vlcerror);
checkerror;
end;
Can someone help me ??
(i know that the playlist function is DEPRECATED so i try to use media list...)
(I will make my Delphi wrapper available when i will have finsh it)
( PS : Excuse me for my englis, but I'm a French developper : http://tfptools.free.fr )
Thanks a lot !
Keypad