Page 1 of 1

VLC 0.9.2 : Delphi Wrapper

Posted: 12 Sep 2008 12:26
by keypad
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) :

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;
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

Re: VLC 0.9.2, libvlc.dll : Media List (Playlist) with Delphi

Posted: 12 Sep 2008 16:17
by keypad
It's very strange, and i don't know how to load a m3u file in a media-list.....

Re: VLC 0.9.2, libvlc.dll : Media List (Playlist) with Delphi

Posted: 19 Sep 2008 18:30
by icebob
Hello!

I created a Delphi wrapper for VLC 0.8.6i one month ago http://wiki.videolan.org/IceVLCPlayer.

Is Your wrapper for 0.9.2 public? Downloadable?

Icebob

Re: VLC 0.9.2, libvlc.dll : Media List (Playlist) with Delphi

Posted: 20 Sep 2008 13:09
by keypad
Hello

Just wait one or 2 weeks and it will be downloadable ! ;-)

Re: VLC 0.9.2, libvlc.dll : Media List (Playlist) with Delphi

Posted: 22 Sep 2008 10:42
by keypad
Here is a link to my project (I haven't finished it yet), VLC0.9.2 is included .
As you can see, i have several problems...If you can Help me i will be very glad !!

Here are the problems :
* Playlist : The playlist items count function is OK but not the playlist item index of the media's playing !! .. if you have a solution ....!
* libpath : I don't know why, but i have to put all the dll in the exe path...

I am a "self-made" developper, i haven't study for this..

Please, if you modify this project, send it to me....we will arrive together !

See you soon !

The link : http://www.tvfreeplayer.com/bin/tfptool ... Player.zip