Following is the netstatus handler for one net stream
Following is the netstatus handler for one net stream
private function nsStatus(e:NetStatusEvent):void
{
trace("ns status : ", e.info.code);
switch (e.info.code)
{
case "NetStream.Play.Start" :
ns.pause();
trace("ns started playing");
break;
case "NetStream.Buffer.Full" :
nsBuffered = true;
if (ns2Buffered == true)
{
ns.resume();
ns2.resume();
}
else
{
ns.pause();
}
trace("NS Buffer Full");
//ns.bufferTime=expandedBufferLength;
break;
case "NetStream.Buffer.Empty":
nsBuffered = false;
ns.pause();
//ns.bufferTime=startBufferLength;
break;
case "NetStream.Buffer.Flush":
break;
}
}
similarly, i am doing for other stream. Also, i am running one timer to update the seek bar. in the timer event handler, i have used one condition to check both nsBuffered and ns2Buffered flag to resume the playback.
It runs ok for sometime but suddenly application gets crashed.
Anyway, i am trying it at my end, but if you can put this topic as a tutorial, it will be really helpful...
Nhận xét
Đăng nhận xét