You should add a listener to your NetStream object, like so:
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
where netStatusHandler
is:
function netStatusHandler(event:NetStatusEvent):void {
switch (event.info.code) {
// some other cases
case "NetStream.Play.StreamNotFound":
trace("Unable to locate vod stream: " + videoURL);
break;
case "NetStream.Play.UnpublishNotify":
trace("Unable to locate live stream: "+ videoURL);
// rest of the cases, default, etc
}
}
The complete list of event.info.code can be found here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetStatusEvent.html but be aware that only the events that begin in NetStream.
are triggered by the NetStream object.