Merge pull request #10426 from eugenp/issue-10366

fix channel type, callback
This commit is contained in:
Loredana Crusoveanu 2021-01-16 16:35:56 +02:00 committed by GitHub
commit b364726c8c
1 changed files with 6 additions and 5 deletions

View File

@ -38,11 +38,7 @@ var input = document.getElementById("messageInput");
function initialize() {
var configuration = null;
peerConnection = new RTCPeerConnection(configuration, {
optional : [ {
RtpDataChannels : true
} ]
});
peerConnection = new RTCPeerConnection(configuration);
// Setup ice handling
peerConnection.onicecandidate = function(event) {
@ -71,6 +67,11 @@ function initialize() {
dataChannel.onclose = function() {
console.log("data channel is closed");
};
peerConnection.ondatachannel = function (event) {
dataChannel = event.channel;
};
}
function createOffer() {