Skip to content

Commit 04fd812

Browse files
author
Dennis Mårtensson
committed
chance of api fic
1 parent a404d7a commit 04fd812

File tree

3 files changed

+8
-300
lines changed

3 files changed

+8
-300
lines changed

example/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@
131131
if (key === 13) {
132132
rtc._socket.send(JSON.stringify({
133133
"eventName": "chat_msg",
134+
"data": {
134135
"messages": input.value,
135136
"room": room,
136137
"color": color
138+
}
137139
}), function(error) {
138140
if (error) {
139141
console.log(error);

example/server.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ webRTC.rtc.on('chat_msg', function(data, socket) {
3636
var socketId = roomList[i];
3737

3838
if (socketId !== socket.id) {
39-
var soc = webRTC.rtc.getSocket(data.room, socketId);
39+
var soc = webRTC.rtc.getSocket(socketId);
4040

4141
if (soc) {
4242
soc.send(JSON.stringify({
4343
"eventName": "receive_chat_msg",
44-
"messages": data.messages,
45-
"color": data.color
44+
"data": {
45+
"messages": data.messages,
46+
"color": data.color
47+
}
4648
}), function(error) {
4749
if (error) {
4850
console.log(error);

example/webrtc.io.js

Lines changed: 0 additions & 297 deletions
This file was deleted.

example/webrtc.io.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../node_modules/webrtc.io-client/lib/webrtc.io.js

0 commit comments

Comments
 (0)