aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/webcam
diff options
context:
space:
mode:
authorandrewdkim <adkim414@gmail.com>2019-11-10 16:23:00 -0500
committerandrewdkim <adkim414@gmail.com>2019-11-10 16:23:00 -0500
commit40c40d377ec169b44e1a9691129e5c7a6b0b10e4 (patch)
tree79b66cbef825fc26b4144e6b209e226ed7175195 /src/client/views/webcam
parent76bc6041ddbbda7ba4c1560199acc08324648e99 (diff)
messages changed to only room instead of server broadcast!
Diffstat (limited to 'src/client/views/webcam')
-rw-r--r--src/client/views/webcam/DashWebRTC.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/webcam/DashWebRTC.ts b/src/client/views/webcam/DashWebRTC.ts
index 846de4115..c61469cb8 100644
--- a/src/client/views/webcam/DashWebRTC.ts
+++ b/src/client/views/webcam/DashWebRTC.ts
@@ -19,6 +19,7 @@ export namespace DashWebRTC {
let turnReady;
let localVideo: HTMLVideoElement;
let remoteVideo: HTMLVideoElement;
+ let curRoom: string = "";
let pcConfig = {
@@ -35,6 +36,8 @@ export namespace DashWebRTC {
export function init(room: string) {
+ curRoom = room;
+
if (room !== '') {
DocServer._socket.emit('create or join', room);
console.log('Attempted to create or join room', room);
@@ -73,7 +76,6 @@ export namespace DashWebRTC {
if (message.message === 'got user media') {
maybeStart();
} else if (message.message.type === 'offer') {
- console.log("I have entered here bro!!!");
if (!isInitiator && !isStarted) {
maybeStart();
}
@@ -82,7 +84,7 @@ export namespace DashWebRTC {
} else if (message.message.type === 'answer' && isStarted) {
pc.setRemoteDescription(new RTCSessionDescription(message.message));
} else if (message.message.type === 'candidate' && isStarted) {
- var candidate = new RTCIceCandidate({
+ let candidate = new RTCIceCandidate({
sdpMLineIndex: message.message.label,
candidate: message.message.candidate
});
@@ -123,7 +125,7 @@ export namespace DashWebRTC {
function sendMessage(message: any) {
console.log('Client sending message: ', message);
- Utils.Emit(DocServer._socket, MessageStore.NotifyRoommates, { message: message, room: "" });
+ Utils.Emit(DocServer._socket, MessageStore.NotifyRoommates, { message: message, room: curRoom });
//DocServer._socket.emit('message', message);
}