[英]Create server-side DVR application to be able to record DVR in FMS
I want to be able to use the DVR compability in FMS3. 我希望能够在FMS3中使用DVR兼容性。 But to do that I need to implement a server-side DVR application it says in the documentation.
但是要做到这一点,我需要实现文档中所说的服务器端DVR应用程序。 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." “您需要添加服务器端ActionScript来处理记录,并向媒体播放器添加正确的客户端ActionScript。”
http://help.adobe.com/en_US/FlashMediaLiveEncoder/3.0/Using/WS0C4F8D5E-0388-4d1e-AE60-D5B3FB1BC682.html http://help.adobe.com/zh_CN/FlashMediaLiveEncoder/3.0/Using/WS0C4F8D5E-0388-4d1e-AE60-D5B3FB1BC682.html
Any help about this server-side script would be greatly appreciated! 关于此服务器端脚本的任何帮助将不胜感激!
Regards Niclas 问候尼古拉斯
I believe this explains the server side script fairly well: 我相信这可以很好地解释服务器端脚本:
http://labs.influxis.com/?p=92 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);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.