也许你应该阅读基本Kurento documentation介绍什么是媒体元素和什么是管道,以更清晰地了解Kurento的API如何工作。
对于您的具体问题,RecorerEndpoint只是媒体元素,能够将文件流作为输入提供给文件。这意味着您可以将RecorderEndpoint连接到任何其他源元素。举例来说,如果你有两个同龄人之间的B2B呼叫,每个节点都将有相关的WebRtcEndpoint使得所得到的管道将是这样的:
Peer A <--------->webRtcEndpointA<==>webRtcEndpointB<---------->Peer B
用于记录从节点A和同伴B都来的流,你只需要创建两个RecorderEndpoints并适当地连接起来,使最终的管道是一样的东西:
------>recorderEndpointA
|
Peer A <--------->webRtcEndpointA<==>webRtcEndpointB<---------->Peer B
|
--->recorderEndpointB
这个源代码应包括:(我ommit样板代码,你已经在你举教程):
pipeline.create('RecorderEndpoint', {uri: "file:///tmp/fileA.webm"}, function(error, recorderEndpointA ...
...
webRtcEndpointA.connect(recorderEndpointA);
recorderEndpointA.record();
pipeline.create('RecorderEndpoint', {uri: "file:///tmp/fileB.webm"}, function(error, recoderEndpointB ...
...
webRtcEndpointB.connect(recorderEndpointB);
recorderEndpointB.record();