projects
/
henge
/
kiak.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
01bded3
)
now we trigger data channel after setting up events!
author
jordan lavatai
<jordanlavatai@gmail.com>
Wed, 5 Jul 2017 17:12:23 +0000
(10:12 -0700)
committer
jordan lavatai
<jordanlavatai@gmail.com>
Wed, 5 Jul 2017 17:12:23 +0000
(10:12 -0700)
client.js
patch
|
blob
|
history
diff --git
a/client.js
b/client.js
index
1f62625
..
956971a
100644
(file)
--- a/
client.js
+++ b/
client.js
@@
-123,15
+123,6
@@
function pollServerForICECandidate(cpc, url, pubKey) {
getPublicKey().then((cpk) => {
console.log('Client: Create and send offer')
const cpc = new RTCPeerConnection(conf)
getPublicKey().then((cpk) => {
console.log('Client: Create and send offer')
const cpc = new RTCPeerConnection(conf)
- /* Start data channel */
- dataChannel = cpc.createDataChannel("sendChannel");
- dataChannel.onmessage = (msg) => {
- console.log(msg.data)
- }
- dataChannel.onopen = () => {
- dataChannel.send(`Hi from the Client`)
- }
-
cpc.oniceconnectionstatechange = () => {
console.log('iceConnectionState = ' + cpc.iceConnectionState)
cpc.oniceconnectionstatechange = () => {
console.log('iceConnectionState = ' + cpc.iceConnectionState)
@@
-174,4
+165,13
@@
getPublicKey().then((cpk) => {
console.log('error in sdp handshake: ' + err)
})
}
console.log('error in sdp handshake: ' + err)
})
}
+ /* Start data channel */
+ dataChannel = cpc.createDataChannel("sendChannel");
+ dataChannel.onmessage = (msg) => {
+ console.log(msg.data)
+ }
+ dataChannel.onopen = () => {
+ dataChannel.send(`Hi from the Client`)
+ }
+
})
})