Using libvlc_media_new_location to open url
Posted: 29 Mar 2015 16:15
Hi -
I am not sure how active this forum is - but I am stuck and could really do with some help . I am using Delphi to interact with the library and I have no problem in opening a media file that is disk-based but cannot get it to work with a url using "libvlc_media_new_location".
here is a summary of the code I am using..
Any help would be MUCH appreciated.
Cheers..
I am not sure how active this forum is - but I am stuck and could really do with some help . I am using Delphi to interact with the library and I have no problem in opening a media file that is disk-based but cannot get it to work with a url using "libvlc_media_new_location".
here is a summary of the code I am using..
Code: Select all
vlcInstance := libvlc_new(0, nil);
// url := 'http://www.youtube.com/watch?v=dDeeapR_yMY&list=PLYutciIGBqC2rqlBw3wVX4LjFlcjtWjGP&index=3';
vlcMedia := libvlc_media_new_location (vlcInstance, 'http://www.youtube.com/watch?v=dDeeapR_yMY&list=PLYutciIGBqC2rqlBw3wVX4LjFlcjtWjGP&index=3');
vlcMediaPlayer := libvlc_media_player_new_from_media(vlcMedia);
libvlc_media_player_set_position(vlcMediaPlayer,0.0);
if libvlc_media_player_will_play(vlcMediaPlayer) then
showmessage('ok')
else
showmessage('wont play');
// now no need the vlc media, free it
//libvlc_media_release(vlcMedia);
// play video in a TPanel, if not call this routine, vlc media will open a new window
libvlc_media_player_set_hwnd(vlcMediaPlayer, Pointer(Panel1.Handle));
// play media
libvlc_media_player_play(vlcMediaPlayer);
Cheers..