Skip to main content
November 23, 2010
Question

How to present videos in FMS to users in a classified way?

  • November 23, 2010
  • 2 replies
  • 1664 views

Uses can log into my site and record camera videos to FMS,

and now I want to present videos that belongs to a specific user in a classfied way,that is:

  1. videos those are being recorded
  2. videos those have already been recorded

Anyone knows how to do this with FMS?

I'm thinking of doing this by storing such information into the database with server side as,using onConnect and onDisconnect,but that's not the most stable way IMO, I don't know whether FMS has a native support for this kind of job...

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    November 23, 2010

    If I understand correctly your first post, you need to read about  Client.readAccess & Client.writeAcces which you can set up per user.

    http://help.adobe.com/en_US/flashmediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7ec3.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7fd8

    November 23, 2010

    Hi,

    FMS doesn't offer any ready solution for the requirement you have stated.

    But to accomplish it in a simple manner, it would be better to use the FMS Server-Side record option using Stream.record( ) API. This will give you control on when the user actually begins to record and stops the record by listening to "NetStream.Record.Start" and "NetStream.Record.Stop" messages.

    When the recorded is stopped you can move the content to a FTP location and configure the FMS to read from that location while serving the content for playback.

    Regards

    Mamata

    November 23, 2010

    Can you provide an example how to listen to "NetStream.Record.Start" and "NetStream.Record.Stop" event at server side?


    November 24, 2010

    Since the users would be capturing the camera feed, a simple code on server-side FMS app may look like, you can further customize as needed.

    application.onConnect=function(clientObj){
        return true;
    };

    application.onPublish = function(clientObj,streamObj){
       trace("onPublish is invoked when publish begins from client side");
        streamObj.onStatus = function(info) {
             trace(info.code); <---------- "NetStream.Record.Start" and "NetStream.Record.Stop" are received here
       }

       streamObj.record("record"); //stream.record([mode],[maxDuration],[maxSize])
    }

    application.onUnpublish = function(clientObj,streamObj){
        trace("on unpublish");
        streamObj.record(false);   
    }

    Regards

    Mamata