spreadcast
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "spreadcast", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Broadcast a WebRTC stream to many subscribers", | ||
@@ -5,0 +5,0 @@ "main": "src/spreadcast.js", |
@@ -21,4 +21,10 @@ var _ = require('eakwell'); | ||
var wsUrl = location.origin.replace(/^http/, 'ws'); | ||
var socket = new WebSocket(wsUrl); | ||
var wsUrl; | ||
if(_.contains(location.origin, 'https')) { | ||
wsUrl = location.origin.replace(/^https/, 'wss'); | ||
} else { | ||
wsUrl = location.origin.replace(/^http/, 'ws'); | ||
} | ||
var socket = Client.socket || new WebSocket(wsUrl); | ||
Client.socket = socket; | ||
@@ -25,0 +31,0 @@ var send = function(data) { |
@@ -96,2 +96,3 @@ var _ = require('eakwell'); | ||
if(room.sender.id == sessionId) { | ||
// Publisher went away -> Terminate stream | ||
delete rooms[name]; | ||
@@ -108,3 +109,8 @@ _.each(room.receivers, function(receiver) { | ||
} else if(room.receivers[sessionId]) { | ||
// Remove receiver and leecher entries | ||
delete room.receivers[sessionId]; | ||
delete room.sender.leechers[sessionId]; | ||
_.each(room.receivers, function(receiver) { | ||
delete receiver.leechers[sessionId]; | ||
}); | ||
} | ||
@@ -111,0 +117,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11329
275