Remove global datachannel.

pull/25/head
Pontus Persson 2017-12-08 17:42:59 +01:00 committed by Pontus Alexander
parent 831fe8fe42
commit 52ea0d8b74
1 changed files with 1 additions and 2 deletions

View File

@ -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);
}); });