У меня проблемы с WebRTC: Я использую этот код из примера, касающегося видеозвонков.WEBRTC Объект # <RTCPeerConnection> не имеет метода 'processSignalingMessage'
if (new_connection) {
console.log('New Peer Connection');
var peer_connection = {};
peer_connection.connection_id = msg.from_connection_id;
peer_connection.pc = createPeerConnection(peer_connection.connection_id,
false);
peer_connections.push(peer_connection);
$('#remote').prepend(remoteVideoHtml.replace('remoteVideoId', 'peer' +
peer_connection.connection_id));
}
//Now process the SDP JSON Blob received
for (var i in peer_connections) {
if (peer_connections[i].connection_id == msg.from_connection_id) {
try {
peer_connections[i].pc.processSignalingMessage(msg.data);
}catch (e) {
console.log("Failed to create processSignalingMessage, exception: " + e.message);
}
Мне нужна помощь, потому что у меня есть одна проблема.
peer_connections[i].pc.processSignalingMessage(msg.data);
Проблема заключается в том:
Object #<RTCPeerConnection> has no method 'processSignalingMessage'
Я не знаю, как работает эти функции и как они invoqued:
pc.onconnecting = function (msg) {
console.log('onSessionConnecting');
}
pc.onopen = function (msg) {
console.log('onSessionOpened');
}
pc.onaddstream = function (event) {
console.log('onRemoteStreamAdded add the remote peers video stream.');
var url = webkitURL.createObjectURL(event.stream);
$('#peer' + connection_id).attr({
src: url
});
}
Я буду признателен за любую помощь.
Heyy Большое спасибо! Теперь он работает !!! – Jcaballerogon