我正在尝试记录添加到 RTCMultiConnection 的每个新会话/用户。
我在应用程序
https://rtcmulticonnection.herokuapp.com/demos/Audio+Video+TextChat+FileSharing.html中使用以下演示 url
现在我在代码中添加了以下 CDN 引用。 https://cdn.webrtc-experiment.com/RecordRTC.js
这是我正在使用但connection.streams[event.streamid].startRecording();
不工作的代码。
// ..................RTCMultiConnection Code.............
// ......................................................
var connection = new RTCMultiConnection();
var btnStopRec = document.getElementById("btnStopRecording");
connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';
connection.enableFileSharing = true;
connection.session = {
audio: true,
video: true,
data: true,
};
connection.sdpConstraints.mandatory = {
OfferToReceiveAudio: true,
OfferToReceiveVideo: true,
};
connection.onstream = function (event)
{
document.body.appendChild(event.mediaElement);
console.log("stream recording starts")
connection.streams[event.streamid].startRecording();
console.log("stream recording started")
}