Skip to content

Commit f06a4a4

Browse files
committed
Fixed URL problems in step 6
1 parent c60fce8 commit f06a4a4

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

step-06/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
<h1>Realtime communication with WebRTC</h1>
1515

16-
<h2><span>Room URL: </span><span id="url">...</span></h2>
17-
1816
<div id="videoCanvas">
1917
<video id="camera" autoplay></video>
2018
<canvas id="photo"></canvas>

step-06/js/main.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
var configuration = null;
1515

16-
var roomURL = document.getElementById('url');
16+
// var roomURL = document.getElementById('url');
1717
var video = document.querySelector('video');
1818
var photo = document.getElementById('photo');
1919
var photoContext = photo.getContext('2d');
@@ -47,7 +47,7 @@ var socket = io.connect();
4747

4848
socket.on('ipaddr', function(ipaddr) {
4949
console.log('Server IP address is: ' + ipaddr);
50-
updateRoomURL(ipaddr);
50+
// updateRoomURL(ipaddr);
5151
});
5252

5353
socket.on('created', function(room, clientId) {
@@ -101,15 +101,15 @@ function sendMessage(message) {
101101
/**
102102
* Updates URL on the page so that users can copy&paste it to their peers.
103103
*/
104-
function updateRoomURL(ipaddr) {
105-
var url;
106-
if (!ipaddr) {
107-
url = location.href;
108-
} else {
109-
url = location.protocol + '//' + ipaddr + ':2013/#' + room;
110-
}
111-
roomURL.innerHTML = url;
112-
}
104+
// function updateRoomURL(ipaddr) {
105+
// var url;
106+
// if (!ipaddr) {
107+
// url = location.href;
108+
// } else {
109+
// url = location.protocol + '//' + ipaddr + ':2013/#' + room;
110+
// }
111+
// roomURL.innerHTML = url;
112+
// }
113113

114114
/****************************************************************************
115115
* User media (webcam)
@@ -135,7 +135,7 @@ function gotStream(stream) {
135135
video.onloadedmetadata = function() {
136136
photo.width = photoContextW = video.videoWidth;
137137
photo.height = photoContextH = video.videoHeight;
138-
console.log('>>>>>> gotStream ', photoContextW, photoContextH);
138+
console.log('gotStream with with and height:', photoContextW, photoContextH);
139139
};
140140
show(snapBtn);
141141
}

0 commit comments

Comments
 (0)