Create server-side DVR application to be able to record DVR in FMS

人盡茶涼 提交于 2019-12-04 20:31:46

I believe this explains the server side script fairly well:

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

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);
  } 

}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!