Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented logic for unique rooms #820

Merged
merged 5 commits into from
Jul 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/editor/Collaboration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ define(function (require, exports, module) {
// immediately ask for camera access
autoRequestMedia: false
});
//To be moved to the bramble API.
var query = (new URL(window.location.href)).searchParams;
this.room = query.get("collaboration") || Math.random().toString(36).substring(7);
console.log(this.room);
this.webrtc = webrtc;
this.pending = []; // pending clients that need to be initialized.
this.changing = false;
};

Collaboration.prototype.init = function(codemirror) {
var self = this;
this.webrtc.joinRoom('thimble', function() {
this.webrtc.joinRoom(this.room, function() {
self.codemirror = codemirror;
self.webrtc.sendToAll("new client", {});
self.webrtc.on("createdPeer", function(peer) {
Expand Down