Hi,
if video is not coming, I'm showing image in my live player (using ns.info.dataBufferByteLength ).
But this is working only with FMLE stream. not working with online broadcaster stream.
if i broadcast stream from online broadcater this code showing every time "No video" in trace.
any another solution to check video is coming or not in my player?
case "NetStream.Play.Start" :
if(ns.info.dataBufferByteLength > 24)
{
trace("video");
image.visible = false;
}
else
{
trace("No video");
image.visible = true;
}
I don't think you are shopwing enough code to properly help explain what you are trying to do - what you show looks like the middle of a switch. In any case, you should be using trace() to see what the status of the conditions are so that you can determine why you always get the same result.
that is only bit code. total is this
function netStatusHandler(event:NetStatusEvent):void
{
trace(event.info.code);
switch (event.info.code)
{
case "NetConnection.Connect.Success" :
netStatusTxt.text = "";
break;
case "NetConnection.Connect.Closed" :
netStatusTxt.text = "Check your internet connection";
break;
case "NetConnection.Connect.Failed" :
netStatusTxt.text = "Check your internet connection";
break;
case "NetStream.Play.Start" :
trace(ns.info.dataBufferByteLength);
if(ns.info.dataBufferByteLength > 24)
{
trace("video");
noVideoimage.visible = false;}
else
{
trace("No video");
noVideoimage.visible = true;}
statusTxt.text = "";
break;
case "NetStream.Play.StreamNotFound" :
trace("Stream not found: " + videoURL);
netStatusTxt.text = "";
break;
default :
}
}
North America
Europe, Middle East and Africa
Asia Pacific