Skip to main content
Participating Frequently
April 26, 2010
Answered

Trouble connecting to live streams

  • April 26, 2010
  • 1 reply
  • 387 views

Hi,

I've been using FMS for a few weeks, and feel relatively comfortable with it, but am currently having some trouble connecting to a live stream in a a video conferencing-type application.

I suspect I'm leaving some small step out, but am having trouble seeing what that step is.

I have one client application open the video camera, connect to the FMS, and publish it's live camera stream to the server. Something like this:

Connect to the FMS

nc.connect("rtmp://<ip addr>9/chat_test/");

In my connection (success) handler:

cam = Camera.getCamera();

cam.addEventListener(StatusEvent.STATUS, statusHandler);

...

ns = new NetStream(nc);

ns.client = new CustomClient();

ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);

ns.attachCamera(cam);

ns.attachAudio(mic);

ns.publish("user1");

This should publish the live stream named "user1" on my FMS instance. Indeed, using the administration console shows that this connection has been established, and a "Live" stream exists with name "user1".

My problem is when I try to open to this stream with a second client:

nc.connect("rtmp://<ip addr>9/chat_test/");

remoteStream = new NetStream(nc);

remoteStream.client = new CustomClient();

remoteStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

remoteStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);

vidPlayer = new Video(cam.width, cam.height);

vidPlayer.attachNetStream(remoteStream);

remoteStream.play("user1", 0);

addChild(vidPlayer);

However, I keep getting "NetStream.Play.StreamNotFound" errors. This seems relatively straightforward, but I'm clearly missing a small step somewhere. Maybe a second pair of eyes can help me find my problem?

Thanks.

    This topic has been closed for replies.
    Correct answer vijay_das

    Replace

    remoteStream.play("user1", 0);

    by

    remoteStream.play("user1");

    the second parameter in play() is start time with default value of -2. Zero means play a VOD from start.

    Check out FMS documentation for details and list of valid values.

    1 reply

    vijay_dasCorrect answer
    Adobe Employee
    April 26, 2010

    Replace

    remoteStream.play("user1", 0);

    by

    remoteStream.play("user1");

    the second parameter in play() is start time with default value of -2. Zero means play a VOD from start.

    Check out FMS documentation for details and list of valid values.