Skip to main content
Known Participant
November 6, 2011
Question

Creating new application problem

  • November 6, 2011
  • 1 reply
  • 2682 views

I try to create a new application to switch streams. I call it "studia".

I place the server-side code in a file named main.asc and create new folder "studia" in the rootinstall/applications folder.

I copy main.asc file to this folder and start Adobe Flash Media Live Encoder 3 and try to broadcast to this URI (localhost/studia) with stream name "livestream1".

My application do not start, in fms consol do not appear application name and Live Encoder say me "Falure to connect to primary server".

I add the string "studia_DIR = C:\Program Files (x86)\Adobe\Flash Media Server 4.5\applications\studia" to the fms.ini file script and restart my computer.

I repeat my attempt - the same answers and no effect from application "studia".

I create folder "mixer" in the rootinstall/applications/studia folder, create folder "script" in this folder, replase main.asc file to it and start Adobe Flash Media Live Encoder 3 and "livestreams" application to broadcast to URI localhost/studia/mixer (or even to  localhost/studia) by two streams with stream names "livestream1" and "livestreams2" - broadcasts are suссesful, the application name "studia/mixer" (or even  studia/_definst_) appear in the fms console with client=2.

But application "studia" do not work.

Here is my main.asc script:

application.myRemoteConn = new NetConnection();

application.myRemoteConn.onStatus = function(info){

    trace("Connect " + info.code + "\n");

    // Reply to all clients

    for (var i = 0; i < application.clients.length; i++){

        application.clients.call("onServerStatus", null, info.code, info.description);

    }

};

// Use NetConnection object to remote server connect (the remote server works with other application wery good)

application.myRemoteConn.connect(rtmp://RemoteServer/live/);

// Server stream estimation

application.myStream = Stream.get("livestream");

if (application.myStream){

    // Switching sequence of liveStreams

    application.myStream.play("liveStream1", -1, 15);

    application.myStream.play("liveStream2", -1, 5, false);

    application.myStream.play("liveStream1", -1, 5, false);

    application.myStream.play("liveStream2", -1, 5, false);

    application.myStream.play("liveStream1", -1, 5, false);

    application.myStream.play("liveStream2", -1, 5, false);

    application.myStream.play("liveStream1", -1, 5, false);

}

I have few questions:

1. Why application "studia" do not start when I create folder "studia" in the rootinstall/applications folder, place main.asc in it and broadcast "livestream1" to this folder by Flash Media Live Encoder?

2. Why application "studia" begin to work only when I create folder "mixer" in the rootinstall/applications/studia folder and place main.asc file to rootinstall/applications/studia/script folder?

3. Why FMS do not execute main.asc script?

What i do wrong?

This topic has been closed for replies.

1 reply

November 8, 2011

You can't load or connect to the studia application because the server-side code contains an error.

Change this line:

application.myRemoteConn.connect(rtmp://RemoteServer/live/);

To this:

application.myRemoteConn.connect("rtmp://RemoteServer/live/");

Copy the main.asc file to the applications/studia folder.

Now you should be able to load an instance of the studia application in the Admin Console, connect to it from FMLE, and stream to it from FMLE.

Jody

Known Participant
November 8, 2011

Thank you very much!

I had corrected my code as you wrote and copy it to the applications/studia folder, I had deleted mixer folder, reloaded the application "studia" from Admin Console.

Instance of the application "studia" still do not be able to load from Admin Console.

Now, I create the "scripts" folder in the applications/studia folder and move main.asc file to it, but main.asc script still do not be executed.

If you can, please answer to me, why application "studia" do not work? Why FMS still do not execute main.asc script?

What i do wrong?

November 10, 2011

To troubleshoot, create the simplest application and add steps one by one, testing as you go. For example:

  1. Reset the fms.ini file to the default settings.
  2. Create a folder called "test" in the applications folder.
  3. Open the Admin Console and launch an instance of the test application.
  4. If you were successful, create a main.asc file and save it to the test folder.  Reload the app.  Add an application.onConnect() call back (if you don't use it, connections are accepted by default, but it's good practice). Reload the app. Add the code from your script section by section, reloading as you go. If the code has an error, the application won't load.

I also suggest watching Graeme Bull's video Administration Console and simple debugging techniques.

Hope that helps,

Jody