Skip to content

Commit

Permalink
chance of api fic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Mårtensson committed Aug 11, 2012
1 parent a404d7a commit 04fd812
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 300 deletions.
2 changes: 2 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@
if (key === 13) {
rtc._socket.send(JSON.stringify({
"eventName": "chat_msg",
"data": {
"messages": input.value,
"room": room,
"color": color
}
}), function(error) {
if (error) {
console.log(error);
Expand Down
8 changes: 5 additions & 3 deletions example/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ webRTC.rtc.on('chat_msg', function(data, socket) {
var socketId = roomList[i];

if (socketId !== socket.id) {
var soc = webRTC.rtc.getSocket(data.room, socketId);
var soc = webRTC.rtc.getSocket(socketId);

if (soc) {
soc.send(JSON.stringify({
"eventName": "receive_chat_msg",
"messages": data.messages,
"color": data.color
"data": {
"messages": data.messages,
"color": data.color
}
}), function(error) {
if (error) {
console.log(error);
Expand Down
297 changes: 0 additions & 297 deletions example/webrtc.io.js

This file was deleted.

1 change: 1 addition & 0 deletions example/webrtc.io.js

0 comments on commit 04fd812

Please sign in to comment.