Skip to main content
Participant
April 4, 2011
Answered

Append stream object to existing file

  • April 4, 2011
  • 1 reply
  • 1138 views

Hello, I'm trying to append a live stream to an existing file, but I cant figure out how to open the existing file and then append the live stream. This is server side as well.

I know I need to open the existing file using stream = stream.get("file"). but I don't understand how to associate stream with the live stream coming in.

PLEASE HELP~!!!

    This topic has been closed for replies.
    Correct answer SE_0208

    Sorry, I'm a noob. I'm tyring to locate applications.xml, but I have limited access to this server. Where would it reside and is this something a host would allow you access to?


    Open notepad and put below text and save it as Application.xml.
    <Application>
    <StreamManager>
    <Live>
    <EraseOnPublish>false</EraseOnPublish>
    </Live>
    </StreamManager>
    </Application>
    Then copy it to your applications folder where your main.asc (i.e. server-side code) is present.

    1 reply

    Participating Frequently
    April 5, 2011

    Try out below code: (assuming you have mystream.flv already on disk)

    mynewstream = Stream.get(mystream);

    mynewstream.onStatus = function(info){

         trace(info.code);

    }

    mynewstream.record("append");

    mynewstream.play("livestream",-1,-1,true);   //where livestream in name of stream getting published.

    Put above code in any server-side method and make call to it or you can put the code in say application.onPublish handler

    vstrazzAuthor
    Participant
    April 5, 2011

    What if mystream is the name of the livestream? I think this is what is causing my new error which doesn't allow me to broadcast at all.

    Participating Frequently
    April 5, 2011

    I would suggest you to do following way in that case, instead of using previous way of code, you can do

    application.onPublish = function(c,s){

         s.record("append");

    }

    and have Application.xml in you applications folder, with <EraseOnPublish> set to false.

    (http://help.adobe.com/en_US/flashmediaserver/configadmin/WS5b3ccc516d4fbf351e63e3d119f2926bcf-7ff0.html#WSA9790036-5127-4e96-8290-A66871529A13)