Error detection on a Network stream.
Posted: 09 Aug 2016 23:11
I have an app that uses the LibVlc dlls and I am trying to display a RTSP network stream. I have been able to get it to work but am now trying to add the error handling.
In the VLC app if I tell it to use a network source that it can not connect to I get a Connection Failed message.
If I use the libVLC functions (see below) the events will be Opening and then Buffering and then nothing else.
So how do I detect Connection Failed with the libvlc functions?
// if you want to play from network, use libvlc_media_new_location instead
vlcMedia := libvlc_media_new_location(vlcInstance, 'rtsp://@192.168.7.22:8554/0');
// create new vlc media player
vlcMediaPlayer := libvlc_media_player_new_from_media(vlcMedia);
// 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(pan_Video.Handle));
// play media
libvlc_media_player_play(vlcMediaPlayer);
(did not show all of the event stuff)
Thanks
Tom
In the VLC app if I tell it to use a network source that it can not connect to I get a Connection Failed message.
If I use the libVLC functions (see below) the events will be Opening and then Buffering and then nothing else.
So how do I detect Connection Failed with the libvlc functions?
// if you want to play from network, use libvlc_media_new_location instead
vlcMedia := libvlc_media_new_location(vlcInstance, 'rtsp://@192.168.7.22:8554/0');
// create new vlc media player
vlcMediaPlayer := libvlc_media_player_new_from_media(vlcMedia);
// 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(pan_Video.Handle));
// play media
libvlc_media_player_play(vlcMediaPlayer);
(did not show all of the event stuff)
Thanks
Tom