1

I'm trying to view a stream that works in JW player, but not in my code. Code:

netcon.connect("rtmp://...");
netcon.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
netcon.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
netcon.addEventListener(IOErrorEvent.IO_ERROR,errorHandler);
netcon.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandler);
...
if (code == "NetConnection.Connect.Success") {
stream = new NetStream(netcon);
stream.client = this;
attachNetStream(stream);
smoothing = true;
deblocking = 1;
stream.play("flv:banana");
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
stream.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandler);
stream.bufferTime = 2;

trace("stream is connecting");

It gets to the bottom block of code, but after that it gets stuck. White screen, stream not connecting, etc

  • Is this the actual code you're using? For example, you need to wait for the `NetStatusEvent` that says the `NetConnection` has connected successfully, before you use the `NetStream`. It sort of looks like you're doing that, but not really. Also, you state, "it gets to the bottom block, but after that it gets stuck." It's not clear from your code what the bottom block is (to me at least). You might also specify which of the event handlers that you've added are being triggered: error event handlers or the `NetStatusEvent` handler... – Sunil D. May 29 '13 at 20:40
  • `if(code=="NetConnection.Connect.Success")` triggers. It's in the proper hook too. – Someguynamedpie May 30 '13 at 02:16

0 Answers0