Skip to main content
Participant
September 11, 2007
Question

Streaming video from FMS2

  • September 11, 2007
  • 4 replies
  • 380 views
I have a video player that will connect but doesn't show the video. The player works fine locally but when I try it online it connects but does not play the video. Here is my code:

var rtmpNow:String = "rtmp://IP ADDRESS/media";
var nc:NetConnection = new NetConnection();
nc.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
info_txt.text = "Connected";
} else {
info_txt.text = "No Connection";
}
};
nc.connect(rtmpNow);
var ns:NetStream = new NetStream(nc);

vid_video.attachVideo(ns);
ns.play("video1");

* I didn't include the IP ADDRESS because, right now, we don't leave that server on all the time.

Can anyone help?
    This topic has been closed for replies.

    4 replies

    Inspiring
    October 3, 2007
    Just to clarify, you are playing a video or a live stream (of a video)?

    You should try to add some error handling to the netstream ( the onsync to start) and see if it shows you any useful information.
    Participant
    October 3, 2007
    I have had problems with establishing connection to my online FMS2. so, after all this might be related...

    the things, is not because we asked the connection that it's there, right?

    my server usually takes up to 8secs to return me something... like in your case, use the play method onRelease, so you can wait a few seconds to call it...

    just an idea really
    Participant
    September 29, 2007
    I'm having the same problem. I have included myConnection.myConn.objectEncoding = flash.net.ObjectEncoding.AMF0;
    If running on a windows platform and I see in the FMS2 is being connected to, but the video doesn't play.

    Participant
    September 19, 2007
    If your using linux, make sure that your video files have the read attribute set for the user which FMS is running under.