Detecting if stream exists?

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
th0r
New Cone
New Cone
Posts: 3
Joined: 17 Sep 2007 17:28

Detecting if stream exists?

Postby th0r » 17 Sep 2007 20:19

Hi everyone,

First off, I'd like to say, the VLC development team, you have my following now. I've only just started within the past month, and you've converted me :D

My problem is quite a confusing one. I have created a webpage based STB piece of software and use the VLC active X control for playback. Using VLC to stream a UDP Multicast stream, and the active X uses a M3U playlist like so:

#EXTM3U
#EXTINF:123,Playlistname
dvdsimple://
udp://@224.0.0.1
offline.ogg

The playlist layout is easy enough, but I do need a fix for the following problem. If there is no DVD in the local drive for where the active X located, it moves onto the next item. Just what I want, but if the UDP stream is not active (because the server is not serving because I choose not to run it or it's crashed for some reason) the VLC active X, just sits there with it's white background and orange cone, it doesn't move on to the next playlist item I.E: offline.ogg. :cry:

It seems that VLC does not accept the fact that the UDP stream is not present.

Is there any known fix for this?

If anymore information is needed, I will try and provide as much as possible.

divx118
Blank Cone
Blank Cone
Posts: 95
Joined: 22 Jun 2006 18:19

Re: Detecting if stream exists?

Postby divx118 » 18 Sep 2007 17:56

Maybe the following would work for you?
If you detect the state of the player and if it is stopped then play the next playlist item.
When you don't know how to do this i can give you a little example in javascript.

Maurice 8)

th0r
New Cone
New Cone
Posts: 3
Joined: 17 Sep 2007 17:28

Re: Detecting if stream exists?

Postby th0r » 18 Sep 2007 19:59

Thanks for the idea, now why didn't that cross my mind?

I have the javascript thats available on the Wiki and am adapting it now, hopefully (as I am using an ICECast server with it's own playlist) VLC won't decide that after each video, that it has stopped :D

This can get messy at the best of times, but trying it when I'm not feeling 100% could be even worst :mrgreen:

Thanks again for the input, and if what I have in mind, doesn't work, I'll gladly ask for your assistance.

divx118
Blank Cone
Blank Cone
Posts: 95
Joined: 22 Jun 2006 18:19

Re: Detecting if stream exists?

Postby divx118 » 18 Sep 2007 20:22

You also can take a look at the source of the test page there is an build in error log in the activeX available maybe it generates an error when your stream is not available wich you can detect. See below the doPlayOrPause() function from that page where it is been used.
function doPlayOrPause()
{
var vlc = getVLC("vlc");
if( vlc.playlist.isPlaying )
{
vlc.playlist.togglePause();
}
else if( vlc.playlist.items.count > 0 )
{
// clear the message log and enable error logging
vlc.log.verbosity = 1;
vlc.log.messages.clear();
vlc.playlist.play();
monitor();
}
else
{
// disable log
vlc.log.verbosity = -1;
alert('nothing to play !');
}
};
With the previous solution I proposed you can use a timer to overcome the problem if the stream is meant to stop for a short time.

Maurice 8)


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 5 guests