Remove global datachannel.
parent
831fe8fe42
commit
52ea0d8b74
|
|
@ -7,7 +7,6 @@ var localStream;
|
||||||
var remoteVideo;
|
var remoteVideo;
|
||||||
var peerConnection;
|
var peerConnection;
|
||||||
var serverConnection;
|
var serverConnection;
|
||||||
var dataChannel;
|
|
||||||
|
|
||||||
function pageReady() {
|
function pageReady() {
|
||||||
document.querySelector("button#start")
|
document.querySelector("button#start")
|
||||||
|
|
@ -41,7 +40,7 @@ function setup() {
|
||||||
dataChannel.channel.send('Hello there, I got your signal');
|
dataChannel.channel.send('Hello there, I got your signal');
|
||||||
});
|
});
|
||||||
|
|
||||||
dataChannel = peerConnection.createDataChannel("myLabel", dataChannelConfig);
|
const dataChannel = peerConnection.createDataChannel("myLabel", dataChannelConfig);
|
||||||
dataChannel.addEventListener('error', function (error) {
|
dataChannel.addEventListener('error', function (error) {
|
||||||
console.log("Data Channel Error:", error);
|
console.log("Data Channel Error:", error);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue