Skip to main content
Participant
May 8, 2006
Question

Create RTMP dynamically

  • May 8, 2006
  • 4 replies
  • 517 views
Hi, how can i create RTMP applications with php?
I need several applications dynamically, that are created when two users connect to a private chat, that is nothing more than a simple chat. The swf is the same, the applications are many. And when they disconnect the chat, the applications will be deleted automatically.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    4 replies

    Participant
    May 9, 2006
    hello Jay, i have this code here
    this.som=new Sound();
    this.som.attachSound("beep");
    this.som.setVolume(40);
    this.som.start(0);
    this.som.onSoundComplete=function(){
    this.som.stop();
    }
    trace("som recebido");

    and i want to hear the sound only when i recieve the message of the other user, where can i post this code on the chat component? i'm using Influxis components.

    I did the sound for the user, that enter to the chat, and the sound to the user that leave the chat, just need to put a sound when the remote user types a message.

    Best Regards
    Paulo Garcia
    May 8, 2006
    You don't need a php process to do that... FMS does it automatically.

    Let's say you have an application named "chat". To use the default instance of the application, your rtmp string would look like:

    rtmp://myserver.com/chat

    If you want a new instance of your app, just append an instance name to the rtmp string like so:

    rtmp://myserver.com/chat/room01

    The server will do the rest. If you don't record any video or have any persistent shared objects, the instance will be removed once it has been idle for a little while.
    Participant
    May 8, 2006
    hey Jay, i'm connecting the app with a invisible simpleconnect, how can i tell him that it will connect to rtmp://server/app/room?
    is there anyway to do that, or connect to FMS without the simplleconnect?
    I have this code, but i don't know if on serverside it works:
    load("components.asc");
    nc.connect.application.onConnect = function (newUser, newuserName){
    gFrameworkFC.getClientGlobals(newUser).userName = newuserName;
    application.acceptConnectio (newUser);
    }


    If i can do a connection with this, i can tell the SWF what vars he is going to put on the rtmp address.
    else, with the simpleconnect, i don't know.

    Best Regards

    Paulo Garcia
    May 9, 2006
    I don't use the prebuilt components, but I imagine there's a variable in there named "username" or "userName" in the simpleconnect. If you assign a value to that variable before the conect method is invoked on the simpleconnect, it should work for you that way. Maybe something like:

    mySimpleConnect.userName = "somename";

    Again... I don't use the components, so I'm just guessing there.

    In your server side .as, there is a syntax problem. Chage this line:

    nc.connect.application.onConnect = function (newUser, newuserName){

    to this:

    application.onConnect = function (newUser, newuserName){