Skip to content

Commit

Permalink
Merge pull request #321 from Sing-Li/webrtc-tidyup
Browse files Browse the repository at this point in the history
Tidy up - removed cruft from the webrtc ib stack; moved stream dependency to core
  • Loading branch information
engelgabriel committed Jul 20, 2015
2 parents 77ab707 + 9dc0383 commit c850cc1
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 53 deletions.
1 change: 1 addition & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ yasaricli:slugify
meteorhacks:kadira
meteorhacks:flow-router
meteorhacks:flow-layout
arunoda:streams@0.1.17
rocketchat:webrtc
1 change: 0 additions & 1 deletion packages/rocketchat-webrtc-ib/common.js

This file was deleted.

5 changes: 1 addition & 4 deletions packages/rocketchat-webrtc-ib/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ Package.onUse(function(api) {

api.use([
'coffeescript',
'rocketchat:lib@0.0.1',
'arunoda:streams@0.1.17'
'rocketchat:lib@0.0.1'
]);

api.addFiles('common.js');
api.addFiles('adapter.js', ['client']);
api.addFiles('webrtc.js', ['client']);
api.addFiles('webrtcmsg.coffee', ['client']);
api.addFiles('server.js', ['server']);

api.export('webrtc')
});
Expand Down
18 changes: 0 additions & 18 deletions packages/rocketchat-webrtc-ib/server.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/rocketchat-webrtc-ib/webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ webrtc = {
{url: "stun:stun.l.google.com:19302"}
]
},
stream: stream,
send: function(data) {
console.log
data.to = webrtc.to;
Expand All @@ -24,7 +23,6 @@ webrtc = {
msg: JSON.stringify(data),
rid: webrtc.room
});
// stream.emit('send', data);

},
stop: function(sendEvent) {
Expand Down
23 changes: 0 additions & 23 deletions packages/rocketchat-webrtc-ib/webrtcmsg.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,6 @@ class IncomingRtcMessageProcessor
if (message.to == Meteor.userId())
if (message.ts > webrtc.lastSeenTimestamp)
webrtc.lastSeenTimestamp = message.ts
# console.log('RTC ' + JSON.stringify(message))
webrtc.processIncomingRtcMessage(JSON.parse(message.msg), message.rid.replace(message.to, ''), message.rid)



# stream.on(Meteor.userId(), function(data) {
# webrtc.log('stream.on', Meteor.userId(), data)
# if (data.close == true) {
# webrtc.stop(false);
# }

# if (!webrtc.pc)
# webrtc.start(false, data.from);
#
# if (data.sdp) {
# webrtc.pc.setRemoteDescription(new RTCSessionDescription(data.sdp));
# } else {
# if( ["closed", "failed", "disconnected", "completed"].indexOf(webrtc.pc.iceConnectionState) === -1) {
# webrtc.pc.addIceCandidate(new RTCIceCandidate(data.candidate));
# }
# }
#});



RocketChat.callbacks.add 'renderRtcMessage', IncomingRtcMessageProcessor, RocketChat.callbacks.priority.LOW
3 changes: 1 addition & 2 deletions packages/rocketchat-webrtc/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Package.onUse(function(api) {

api.use([
'coffeescript',
'rocketchat:lib@0.0.1',
'arunoda:streams@0.1.17'
'rocketchat:lib@0.0.1'
]);

api.addFiles('common.js');
Expand Down
10 changes: 7 additions & 3 deletions server/stream/streamBroadcast.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@


Meteor.startup ->
startStreamBroadcast
'webrtc.stream': webrtc.stream
'typing': typingStream
if webrtc
startStreamBroadcast
'webrtc.stream': webrtc.stream
'typing': typingStream
else
startStreamBroadcast
'typing': typingStream

0 comments on commit c850cc1

Please sign in to comment.