問題描述
在 Nodejs 中使用 Kurento 複合媒體元素進行音頻會議需要幫助 (Need help for audio conference using Kurento composite media element in Nodejs)
我正在裁判 GitHub 中的代碼,用於使用 Kurento 複合媒體元素進行音頻和視頻會議,它通過 WebRTC 進行音頻和視頻流工作很好。
但我只需要使用 WebRTC 進行音頻會議,我在上面的 GitHub 代碼中添加了更改,新代碼已上傳到 GitHub 存儲庫。我在 static/js/index.js 文件中添加了以下更改
var constraints = {
audio: true, video: false
};
var options = {
localVideo: undefined,
remoteVideo: video,
onicecandidate : onIceCandidate,
mediaConstraints: constraints
}
webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error) {
當我運行此代碼時,節點服務器和 chrome 控制台都沒有錯誤。但是音頻流沒有開始。它只顯示微調器很長一段時間。Chrome 控制台日誌是 here。
根據我之前的回复 堆棧溢出問題,我們需要指定 MediaType.AUDIO 在 java 代碼中,如下所示
webrtc.connect(hubport, MediaType.AUDIO);
hubport.connect(webrtc, MediaType.AUDIO);
但我想使用 kurento‑client.js 在 Nodejs 中實現它,我在 Nodeja API 中設置 MediaType.AUDIO 以與 hubPort 和 webRtcEndpoint 連接沒有得到任何參考。 p>
參考解法
方法 1:
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"
(by Nilesh Wagh、igracia)