Skip to content

Commit

Permalink
webrtc: Implement for node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnor committed Apr 22, 2016
1 parent b164e5f commit 9f9081c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
],
"dependencies": {
"coffee-script": "1.10.0",
"rtc": "^3.4.0",
"rtc-plugin-node": "^2.3.0",
"websocket": "1.0.22"
},
"optionalDependencies": {
Expand Down
9 changes: 9 additions & 0 deletions src/webrtc.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
Base = require './base'
platform = require '../helpers/platform'

if platform.isBrowser()
RTC = window.RTC
rtcPlugins = []
else
RTC = require 'rtc'
rtcPlugins = [ require('rtc-plugin-node') ]

class WebRTCRuntime extends Base
constructor: (definition) ->
Expand Down Expand Up @@ -49,6 +57,7 @@ class WebRTCRuntime extends Base
capture: false
constraints: false
expectedLocalStreams: 0
plugins: rtcPlugins

@peer = RTC options
@peer.on 'channel:opened:chat', (id, dc) =>
Expand Down

0 comments on commit 9f9081c

Please sign in to comment.