Fixed serious bug in signaling-js
This commit is contained in:
parent
4eecfe6291
commit
4b7dee3633
|
@ -16,12 +16,12 @@ let pcPeers = {}; // peer connection
|
||||||
let localstream;
|
let localstream;
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
if (document.getElementById("current-user")) {
|
// if (document.getElementById("current-user")) {
|
||||||
currentUser = document.getElementById("current-user").innerHTML;
|
currentUser = document.getElementById("current-user").innerHTML;
|
||||||
console.log(currentUser)
|
console.log(currentUser)
|
||||||
localVideo = document.getElementById("local-video");
|
localVideo = document.getElementById("local-video");
|
||||||
remoteVideoContainer = document.getElementById("remote-video-container");
|
remoteVideoContainer = document.getElementById("remote-video-container");
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Ice Credentials
|
// Ice Credentials
|
||||||
|
@ -37,10 +37,10 @@ document.onreadystatechange = async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
localstream = stream;
|
localstream = stream;
|
||||||
if (localVideo) {
|
// if (localVideo) {
|
||||||
localVideo.srcObject = stream
|
localVideo.srcObject = stream
|
||||||
localVideo.muted = true
|
localVideo.muted = true
|
||||||
}
|
// }
|
||||||
} catch (e) { console.error(e); }
|
} 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 chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"]
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
const handleJoinSession = async () => {
|
const handleJoinSession = async () => {
|
||||||
App['chatroom' + chatroomId] = await App.cable.subscriptions.create({
|
App['chatroom' + chatroomId] = await App.cable.subscriptions.create({
|
||||||
|
|
Loading…
Reference in New Issue