|
@@ -61,6 +61,12 @@ function createRemoteConnection(remoteDescJSON) {
|
|
console.log('onDataChannel')
|
|
console.log('onDataChannel')
|
|
const receiveChannel = e.channel;
|
|
const receiveChannel = e.channel;
|
|
console.dir(receiveChannel);
|
|
console.dir(receiveChannel);
|
|
|
|
+ const sendButton = document.getElementById('sendDataBtn')
|
|
|
|
+ sendButton.addEventListener('click', sendMessage, false)
|
|
|
|
+ function sendMessage() {
|
|
|
|
+ const messageText = document.getElementById('sendData').value;
|
|
|
|
+ receiveChannel.send(messageText);
|
|
|
|
+ }
|
|
receiveChannel.onopen = () => {
|
|
receiveChannel.onopen = () => {
|
|
console.log('channel open')
|
|
console.log('channel open')
|
|
receiveChannel.send('testing testing 123');
|
|
receiveChannel.send('testing testing 123');
|