Skip to main content
Participant
August 26, 2008
Answered

Rename _definst_

  • August 26, 2008
  • 1 reply
  • 522 views
Hi all..

I am sending live video streams over Flash Media Server 3.0. I am using following code.

camCon = new NetConnection();
camCon.connect("rtmp://localhost/higherup/_definst_");
myCam = Camera.get();
myCam.setMode( 300, 230, 100);
myCam.setQuality(0, 100);
camStream = new NetStream(camCon);
camStream.attachVideo(myCam);
camStream.publish("_definst_", "live");
myPlayer.load("rtmp://localhost/higherup/_definst_", true);

It all works fine. This code connects my webcam to flash movie and stream it through FMS. In the last line of code, I am catching the stream and attaching to FlvPlayback control.

Now the problem is, I want to change the name of stream from "_definst_" to something else, lets say "_raheel_". This renaming of default instance doesnt work..... I cant see my webcam playing....

camStream.publish("_raheel_", "live");
OR
myPlayer.load("rtmp://localhost/higherup/_raheel_", true);

These above 2 lines are example of what I want to do.


Please help. Thanks in advance.

Raheel
    This topic has been closed for replies.
    Correct answer Niteprince
    Big Thanks.
    You saved my life. Appreciated.

    1 reply

    August 26, 2008
    From the URL format; myPlayer is probably a FLVPlayback component based; so you need to stick with the correct URL conventions.

    If you publish with following code:

    camCon.connect("rtmp://localhost/higherup/_definst_");
    camStream.publish("_raheel_", "live");

    The playback URL would be:
    myPlayer.load("rtmp://localhost/higherup/_definst_/_raheel_", true);
    OR
    myPlayer.load("rtmp://localhost/higherup/_raheel_", true);

    _definst_ is the instance name on FMS; in a simple setup, both publish and playback need to use same the instance name. mentioning _definst_ is not required as it is the default value when instance name is not mentioned that's why it will work if you remove _definst_ from all of your code.
    NiteprinceAuthorCorrect answer
    Participant
    August 27, 2008
    Big Thanks.
    You saved my life. Appreciated.