Merge pull request #29 from beatriceo/signaling-fix

Fixed serious bug in signaling-js
This commit is contained in:
Beatrice Olivera 2018-08-31 14:26:53 +01:00 committed by GitHub
commit 2d20473270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -16,12 +16,12 @@ let pcPeers = {}; // peer connection
let localstream;
window.onload = () => {
if (document.getElementById("current-user")) {
// if (document.getElementById("current-user")) {
currentUser = document.getElementById("current-user").innerHTML;
console.log(currentUser)
localVideo = document.getElementById("local-video");
remoteVideoContainer = document.getElementById("remote-video-container");
}
// }
};
// Ice Credentials
@ -37,10 +37,10 @@ document.onreadystatechange = async () => {
})
localstream = stream;
if (localVideo) {
// if (localVideo) {
localVideo.srcObject = stream
localVideo.muted = true
}
// }
} catch (e) { console.error(e); }
}
};
@ -72,10 +72,10 @@ document.onreadystatechange = async () => {
// });
// };
if (document.getElementById('chatroom-hook')) {
// if (document.getElementById('chatroom-hook')) {
const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"]
}
// }
const handleJoinSession = async () => {
App['chatroom' + chatroomId] = await App.cable.subscriptions.create({