How to detect when a remote client has started/stopped streaming video over his NetStream with RTFMP in AS3?

726 Views Asked by At

Am building a video chat application and i was wondering if there are any native events for the NetStream that fire , that can help in detecting when a remote client starts/stops streaming video over his outgoing stream (NetStream) to which the other client has subscribed over P2P/RTFMP in AS3 ?.

I maybe able to dispatch custom messages since the two clients are already connected, but i don't want to add the extra overhead.

1

There are 1 best solutions below

2
Thomas Brasington On

All the event codes for NetStatusEvent can be found here

You just need to have the listener set up and look for "NetStream.Play.Start" and "NetStream.Play.Stop"

e.g.

private function netStatusHandler(event:NetStatusEvent):void
{
// handles net status events
switch (event.info.code)
{
case "NetConnection.Play.Start" :

//do stuff

break;
}
}