samedi 18 juin 2016

How to pause and restart a NetStream object?

I have a NetStream object, based upon the following code:

streamID = "mystreamkey";
videoURL = "rtmp://mystreamurl";

vid = new Video();

nc = new NetConnection();

nc.addEventListener(NetStatusEvent.NET_STATUS, onConnectionStatus);
nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
nc.client = { onBWDone: function():void{}, streamConnected: streamConnected, streamDisconnected: streamDisconnected };


metaListener = new Object();
metaListener.onMetaData = received_Meta;
netStreamObj.client = metaListener;;

All this is working fine, and I can also use netStreamObj.pause() to pause the live stream.

But how do I restart it? won't work - it requires one parameter, so then I wrote this:;

But this isn't working either.

How do I restart the stream, so that it connects to the live stream it was previously connected to?

Aucun commentaire:

Enregistrer un commentaire