创建服务器端DVR应用程序,以便能够在FMS中录制DVR [英] Create server-side DVR application to be able to record DVR in FMS

查看:189
本文介绍了创建服务器端DVR应用程序,以便能够在FMS中录制DVR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在FMS3中使用DVR兼容性。但要做到这一点,我需要实现一个服务器端的DVR应用程序,它在文档中说。问题是我找不到任何这样的例子。
$ b $你需要添加服务器端ActionScript来处理记录和正确的客户端ActionScript到您的媒体播放器。



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



关于这个服务器端脚本的任何帮助将不胜感激!



关注Niclas


 

code> 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。开始,描述:streamname});


Client.prototype.FCUnpublish = function(streamname)
{
this.call(onFCUnpublish,null,{code:NetStream.Unpublish。成功,说明:streamname});




$ b Client.prototype.releaseStream =函数(流名称)
{}

客户端.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);
}

}


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

解决方案

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

}

这篇关于创建服务器端DVR应用程序,以便能够在FMS中录制DVR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆