I want it to automatically detect if there's a live video,then play live;otherwise play back.
How to do it that way?
I want it to automatically detect if there's a live video,then play live;otherwise play back.
How to do it that way?
Politely ask the server?
(no that is the actual answer)
EDIT: I MEANT (as someone apparently does not understand) to keep a variable on the server, like isLive, which will be changed based on if something IS live or not. Then, before you start to stream anything, check for that in the client, maybe using a simple HTTP request. If something is live, again, HTTP request for something like "liveStream.php", if not then "some-other-video.flv"...
Also, if nothing is live, but the request for liveStream.php is still sent, just transmit something like "media offline" or whatever.
To ensure the live stream automatically turns off (in client), either check for the isLive variable periodically (like 10 second interval), or (IF you have got FMS, or anything that works with OSMF really) use the metadata that can be transmitted along A/V in FLV format.
Currently, there is no way to detect if a stream is live or not. You need some kind of metadata passed into the player (like Aurel300 suggested).
-Andrian