Skip to main content
Participating Frequently
October 17, 2007
Question

FMS2 RTMP

  • October 17, 2007
  • 2 replies
  • 465 views
We have installed the developer edition on FMS2 on a Windows 2000 server. We have been able to see a connection to an instance of our application. But, when we expect to see a video streaming there is nothing. We are unsure of which main.asc file to use in the root of our application FMS2 folder. There is no indication of any documentation regarding this technology that we are aware of that explains it to us in an elementary fashion - we just want to stream video for cry'n out loud! - Very frustrated but want to leverage this technology. Any help with this would be great especially any details regarding the server install and setup to use video streaming capabilities.

Here is our AS3 code we are using:

package {
import flash.display.MovieClip;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.ObjectEncoding;
import flash.system.Security;
import flash.media.Video;
import flash.events.*;
import flash.text.TextField;

public class MyVideo extends MovieClip{
public var nc:NetConnection;
public var stream:NetStream;
public var video:Video;
//public var onBWDone:Function;

public function MyVideo(){
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, playVideo);
nc.objectEncoding = ObjectEncoding.AMF0;
//nc.setId = function(n:Number):void{};
//nc.connect("rtmp:/testApp/streams");
nc.connect("rtmp://172.16.1.83/testApp/streams");
trace(Security.sandboxType);

}


public function playVideo(evt:NetStatusEvent):void {
txt.text = evt.info.code;
switch (evt.info.code) {
case "NetConnection.Connect.Success" :
connectStream();
trace("My code is done");
break;
case "NetStream.Play.StreamNotFound" :
trace("Unable to locate video: ");
break;
default:
trace("The connection failed");
break;
}
}

public function connectStream():void {
trace("CONNECTED");
var stream:NetStream = new NetStream(nc);
stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

var video:Video = new Video();
video.attachNetStream(stream);
addChild(video);
stream.play("test.flv");
}

public function asyncErrorHandler(event:AsyncErrorEvent):void {
trace("SOMETHING BAD");
}

public function onBWDone(info:Object):void{
}

public function netStatusHandler(event:NetStatusEvent):void{
//trace(event.text);
}

}
}
    This topic has been closed for replies.

    2 replies

    October 17, 2007
    sorry for the quick rants

    also,

    leave the streams directory

    connect to: nc.connect("rtmp://172.16.1.83/testApp");

    not

    nc.connect("rtmp://172.16.1.83/testApp/streams");
    Participant
    December 13, 2007
    i did all the below, but all i get is : .
    localTrusted
    CONNECTED
    My code is done

    all i changed is the following line
    nc.connect("rtmp://localhost/1/videodisplay/streams");

    and also the file name: newfile.flv or used Newfile without the .flv.

    and nothing is played. this is extremely annoyed
    how can we stream from fms??????.
    I wish that Adobe experts post a descriptive article of how to stream from flash media server2
    and also i can't find the main.asc.
    i found one in another example but i don't know even if it will work or not.
    We depend on this and i can't decide whether to buy the product or not.
    i don't know
    even i wish that Adobe can have an email for contact.
    i'm just in this looping from about 2 weeks....
    PLZ ADOBE help the users like us.
    Participating Frequently
    December 13, 2007
    Just to hopefully get this resolved, I would like to jump on the FMS2 band-wagon...I am experiencing the same identical issue that you are having. I've installed the FM2 server, I can see the file requested as a stream on the server que but cannot actually view the streaming video. My hope is that someone post a simple PDF at Adobe with a step by step that can enlighten me on if FMS2 actually works on Windows Server. Kinda' hard to influence the IT Manager to dump thousands on a solution that I can't even demo.
    October 17, 2007
    hey replace this stream.play("test.flv"); with this stream.play("test");


    see if that helps. when streaming a video you don't need to add the .flv extension.

    good luck