views:

811

answers:

3

Hi

I want to be able to use the DVR compability in FMS3. But to do that I need to implement a server-side DVR application it says in the documentation. The problem is I cannot find any example on this.

"You need to add server-side ActionScript to handle the recording and the correct client-side ActionScript to your media player."

http://help.adobe.com/en_US/FlashMediaLiveEncoder/3.0/Using/WS0C4F8D5E-0388-4d1e-AE60-D5B3FB1BC682.html

Any help about this server-side script would be greatly appreciated!

Regards Niclas

A: 

I believe this explains the server side script fairly well:

http://labs.influxis.com/?p=92

quoo
A: 

Yes it does, but I still don't get the DVR-functionality to work. When I press the DVR Record button in FLE I get an error that says:

Primary - Network Status: NetConnection.Call.Failed error Method not found (DVRSetStreamInfo).

Any help?

A: 

So now it works, here is the server-side code for those who need it sometime:

application.onAppStart = function()
{}

application.onConnect = function(p_c)
{
  this.acceptConnection(p_c);
}

application.onPublish = function (p_c, p_stream)
{
   p_stream.record();
}

application.onUnpublish = function(p_c, p_stream)
{
   p_stream.record(false);
}

Client.prototype.FCPublish = function(streamname) 
{ 
   this.call("onFCPublish", null, { code:"NetStream.Publish.Start", description:streamname } ); 
} 

Client.prototype.FCUnpublish = function(streamname) 
{ 
    this.call("onFCUnpublish", null, { code:"NetStream.Unpublish.Success", description:streamname } ); 
} 




Client.prototype.releaseStream = function(streamname) 
{}

 Client.prototype.DVRSetStreamInfo = function(info)
 { 

    s = Stream.get("mp4:" + info.streamName + ".f4v");

    if (s) 
    {    

       if (info.append)
          s.record("append");

       else
          s.record();

       s.play(info.streamName);
  } 

}