Page 1 of 1

How to know if the stream is playing ?

Posted: 04 May 2011 11:23
by Maloupi
Hi,

I'm using libvlc_vlm_play_media to stream live cameras.
I need to know if the stream is playing or not (if an error occurs for example).
How can i do this ? Which function do i have to use ?

Re: How to know if the stream is playing ?

Posted: 04 May 2011 11:32
by Sébastien Escudier

Re: How to know if the stream is playing ?

Posted: 04 May 2011 11:33
by Maloupi
Thank you.
Is there a tutorial or a quick help on how to use it ?

Re: How to know if the stream is playing ?

Posted: 04 May 2011 11:48
by Sébastien Escudier

Re: How to know if the stream is playing ?

Posted: 04 May 2011 11:56
by Maloupi
Thank you

Re: How to know if the stream is playing ?

Posted: 04 May 2011 15:59
by Maloupi
For information :
I'm finally using the libvlc_vlm_get_media_instance_time function.
If the time is > 0, i consider that my stream is really playing.

Re: How to know if the stream is playing ?

Posted: 04 May 2011 16:05
by Sébastien Escudier
yes.
But with events you wouldn't need to call the function until the media is actually started.
And you are notified when it ends/errors

Re: How to know if the stream is playing ?

Posted: 04 May 2011 16:33
by Maloupi
With events i can't distinguish which media i am looking at.
I added several broadcast streams to a vlc instance (with libvlc_vlm_add_broadcast)
If i want to know if, for example, the second stream is playing, i don't know how to do because the event manager is for one instance (libvlc_VlmMediaInstanceStatusPlaying), not one stream.

Re: How to know if the stream is playing ?

Posted: 04 May 2011 16:40
by Sébastien Escudier
Not true...
in the events callback parameter, you have a field psz_media_name
so you know which media it is.

Re: How to know if the stream is playing ?

Posted: 04 May 2011 16:56
by Maloupi
Sorry, my fault, i didn't see it.
I will look at this again and better ;-)
Thank you.