Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Kurento IceConnection未解析_Javascript_Node.js_Kurento - Fatal编程技术网

Javascript Kurento IceConnection未解析

Javascript Kurento IceConnection未解析,javascript,node.js,kurento,Javascript,Node.js,Kurento,我目前正在试用Kurento Media Server,用NodeJS、Socket.io和React重建One2Many示例,但我似乎无法在发布者和KMS之间建立联系 SDP报价发送至KMS,应答发送至客户端。来自KMS和客户机的每个ICE候选也会被传输。视频反馈显示在应用程序上,但没有向服务器发送任何内容,也没有错误。这是chrome://webrtc-internals用于我的应用程序 示例应用程序与同一台Kurento服务器完美配合,我检查了每一行,在后端和前端执行相同的调用。这是ch

我目前正在试用Kurento Media Server,用NodeJS、Socket.io和React重建One2Many示例,但我似乎无法在发布者和KMS之间建立联系

SDP报价发送至KMS,应答发送至客户端。来自KMS和客户机的每个ICE候选也会被传输。视频反馈显示在应用程序上,但没有向服务器发送任何内容,也没有错误。这是
chrome://webrtc-internals
用于我的应用程序

示例应用程序与同一台Kurento服务器完美配合,我检查了每一行,在后端和前端执行相同的调用。这是
chrome://webrtc-internals
用于示例应用程序

作为参考,以下是我在后端使用的代码(本例中的错误检查已被删除,但在我使用它时没有引起任何错误):

io.on('connect',(socket)=>{
const socketInfo={};
socketInfo.webrtcEndpointCreation=新承诺((解决、拒绝)=>{
socketInfo.webrtcEndpointCreationResolve=resolve;
socketInfo.webrtcEndpointCreationReject=拒绝;
});
socket.on('广播',(信息,回调)=>{
创建('MediaPipeline',(mediaPipelineError,pipeline)=>{
mediaPipeline=管道;
创建('WebRtcEndpoint',(webRtcEndpointError,WebRtcEndpoint)=>{
socketInfo.webRtcEndpoint=webRtcEndpoint;
presenterWebRtc=WebRTC端点;
socketInfo.webrtcEndpointCreationResolve();
webRtcEndpoint.on('OnIceCandidate',(事件)=>{
socket.emit('iceCandidate',
新的kms.lib.register.complexTypes.IceCandidate(event.candidate));
});
webRtcEndpoint.processOffer(infos.sdpOffer,(error,sdpAnswer)=>{
回调(null,sdpAnswer);
});
webRtcEndpoint.gather候选者();
});
});
});
socket.on('iceCandidate',(candidate)=>{
socketInfo.webrtcEndpointCreation.then(()=>{
socketInfo.webRtcEndpoint.addIceCandidate(候选);
});
});
});
这是客户端代码:

const options = {
  localVideo: document.getElementById('video'),
  onicecandidate: (candidate) => {
    global.socket.emit('iceCandidate', candidate);
  }
};

this.kurentoSocket = new WebRtcPeer.WebRtcPeerSendonly(options, (error) => {
  this.kurentoSocket.generateOffer((err, sdpOffer) => {
    global.socket.on('iceCandidate', (iceCandidate) => {
      this.kurentoSocket.addIceCandidate(iceCandidate);
    });
    global.socket.emit('broadcast', { sdpOffer }, (broadcastErr, sdpAnswer) => {
      this.kurentoSocket.processAnswer(sdpAnswer);
    });
  });
});

我终于发现了问题,这是一个后端问题

在添加之前,我需要从客户端发送的消息中创建一个带有
new kms.lib.register.complexTypes.IceCandidate(candidate)
的IceCandidate对象。由于承诺的工作方式,错误被忽略了