Skip to main content
Participating Frequently
January 11, 2007
Question

recording from browser

  • January 11, 2007
  • 4 replies
  • 777 views
Hey guys, I'm completely new to flash, what i'm trying to do is to create application which makes user able to record their voice from the browser and save it somewhere to the filesystem. i also need control over the location that the file gets saved and also the name of it. can anybody help me with example or a reference or anything???
thanks a lot
    This topic has been closed for replies.

    4 replies

    allinnycAuthor
    Participating Frequently
    January 15, 2007
    Thanks again, actually during the weekend we were able to do that, it was amazing to me how simple that was - the only thing that we have to figure out now is how to write the created file on some /x/y/z path on the file server. any suggestions?
    Inspiring
    January 17, 2007
    quote:

    Originally posted by: allinnyc
    Thanks again, actually during the weekend we were able to do that, it was amazing to me how simple that was - the only thing that we have to figure out now is how to write the created file on some /x/y/z path on the file server. any suggestions?



    I don't think you can record the stream to a custom path (it always writes to "application/APPNAME/INSTNAME/streams/STREAMNAME.flv"), but AFTER recording you can use File.renameTo() to rename the file to anything you want.


    Barry
    allinnycAuthor
    Participating Frequently
    January 17, 2007
    >>it always writes to "application/APPNAME/INSTNAME/streams/STREAMNAME.flv"
    so is this "always" the case? is there an attribute telling you where exactly it is writing the file to?

    as i understand you can have up to thousands of streams with FMS, i wonder if this exceed the number of i-nodes on the filesystem! i know that some filesystems don't like to hold more than few hundred files.
    January 15, 2007
    FMS has a few examples which almost work immediately out of the box.

    In short if you want to publish a webcamstream to an FMS server you need to do these steps:

    1. select a webcam on your flash client
    2. open a netconnection to your fms server (netconnection.connect)
    3. open a netstream object
    4. attach your video/webcam object to the netstream object
    5. publish the netstream

    on the server you want to

    1. check if the incoming user is valid (in the .onConnect event)
    2. accept or deny his connection (acceptConnection() or rejectConnection())
    3. sit and wait until the user is done
    4. perform whatever you want in the onDisconnect() event

    on a (viewing) client you need to do this:

    1. create a videobject
    2. open a netconnection
    3. create a netstream
    4. attach it to your videoobject
    5. start playback


    Both client-publish and client-viewing code isn't more than 10-15 lines of code.

    Check out the docs. They aren't perfect but will tell you 99,9% of what you need to do.
    January 12, 2007
    Lol, don't blame the community for not replying fast enough to your questions.

    This is the Flash Media Server forum , your question should go in the general Flash forum(s) if you want more and faster replies.

    You can record voice and images from Flash but you need a server to record to. For example Flash Media Server. FMS can record the file on it's server , in FLV format.

    a. You can request that file afterwards either by making a simple FLV player that requests the FLV file using the HTTP protocol (=progressive = download it, no streaming) (assuming you have a webserver installed next to your FMS server and that the webserver can access the paths where the FMS server wrote the FLV file to)

    b. You could make a netconnection to your FMS server and request the file using the streaming method

    If you'd use method you could download the binary FLV file to your clients PC and let him store in locally but you need to write your own download mechanism.
    allinnycAuthor
    Participating Frequently
    January 12, 2007
    THANK YOU VERY MUCH, for the reply :)

    >>You can record voice and images from Flash but you need a server to record to.
    >>For example Flash Media Server. FMS can record the file on it's server , in FLV format.

    this is exactly the part that I'm interested in, the FMS part.
    is it just simply opening a connection and have the server save the stream? are they all built in or do i need to write a module for it? is there any manual which tells me how to accept a connection, start/stop the stream, etc (server side)? and one very important question to me is that, can the client have control over where the server writes the file? or name the file?

    Thanks again, really appreciate it
    allinnycAuthor
    Participating Frequently
    January 11, 2007
    this is what i don't like about softwares like flash, it doesn't have enough user group support, it this was a java question i was bombarded by answers right now :(