1

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.

Community
  • 1
  • 1
Nilesh Wagh
  • 940
  • 1
  • 12
  • 26

1 Answers1

3

This should do

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

We are in the process of improving the documentation of the project. I hope that this will all be made more clear in the new docs.


EDIT 1

It is important to make sure that you are indeed sending something, and that the connection between your client and the media server is negotiated correctly. Going through your bower.json, I've found that you are setting the adapter dependency as whatever, so to speak. In the latest releases, they've done some refactoring that makes the kurento-utils-js library fail. We haven't yet adapted to the new changes, so you need to fix the dependency of adapter.js like so

"adapter.js": "v0.2.9"
igracia
  • 3,543
  • 1
  • 18
  • 23
  • I have added changes according to above answer, but still I am getting same issue. New code is uploaded on [GitHub](https://github.com/Nileshwagh22/kurento-composite-media-element-for-audio/blob/master/server.js). Please suggest me any other changes if required. – Nilesh Wagh Apr 08 '16 at 06:33
  • I think you are not sending anything, as your adapter.js version should be fixed to v0.2.9 – igracia Apr 08 '16 at 07:28
  • 1
    @NileshWagh I've got your code to run. Please change the adapter version, as the kurento-utils-js library was screaming that it couldn't find the `RTCPeerConnection` object. Once I fixed the dependency version, I got it working. – igracia Apr 08 '16 at 07:45
  • I have changed version of adapter.js from existing to v0.2.9, But still I have same issue. Have you done any other changes to make it working? – Nilesh Wagh Apr 08 '16 at 09:44
  • @NileshWagh No other changes, except the KMS address. I'm using one of my own. Did you check your KMS instance with any of the tutorials? – igracia Apr 08 '16 at 09:51
  • Yes, KMS is working for other sample as well as working for same sample for audio AND video. Issue is with current audio only sample. Which KMS version you have? I am using KMS 6.0. – Nilesh Wagh Apr 08 '16 at 10:00
  • 1
    Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/108612/discussion-between-igracia-and-nilesh-wagh). – igracia Apr 08 '16 at 10:04