Need help for audio conference using Kurento composite media element in Nodejs

时间:2016-04-07 10:39:24

标签: node.js webrtc audio-streaming kurento

I am refereeing the code from GitHub for audio AND video conference using Kurento composite media element, It work's fine for audio AND video streaming over WebRTC.

But I need only audio conference using WebRTC, I have added changes in above GitHub code and new code is uploaded on GitHub Repository. I have added below changes in static/js/index.js file

var constraints = {
    audio: true, video: false
};

var options = {
    localVideo: undefined,
    remoteVideo: video,
    onicecandidate : onIceCandidate,
    mediaConstraints: constraints
}
webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error) {

When I am running this code, no error for node server as well as on chrome console. But audio stream does not get start. It only showing spinner for long time. Chrome console log is here.

As per reply for my previous stack overflow question, We need to specify MediaType.AUDIO in java code like below

   webrtc.connect(hubport, MediaType.AUDIO);
   hubport.connect(webrtc, MediaType.AUDIO);

But I want to implementing it in Nodejs using kurento-client.js, I did not get any reference to set MediaType.AUDIO to connect with hubPort and webRtcEndpoint in Nodeja API.

Please someone can help me to do code changes for same in Nodejs or suggest me any reference so I can implement only audio conference using composite media element and Nodejs.

1 个答案:

答案 0 :(得分:3)

这应该

function connectOnlyAudio(source, sink, callback) {
    source.connect(sink, "AUDIO" , function(error) {
       if (error) {
           return callback(error);
       }
       return callback(null);
    });
}

我们正在改进项目的文档。我希望在新文档中这一切都会更加明确。

编辑1

确保您确实正在发送内容并确保客户端与媒体服务器之间的连接正确协商非常重要。通过您的bower.json,我发现您将适配器依赖项设置为无论,可以这么说。在最新版本中,他们进行了一些重构,使kurento-utils-js库失败。我们还没有适应新的变化,所以你需要修复adapter.js的依赖关系,如此

"adapter.js": "v0.2.9"