Removed comments, spacing and changed password

This commit is contained in:
ShakedAp
2023-06-25 13:57:02 +03:00
parent e1a1ab706f
commit 7d5bac659c
5 changed files with 4 additions and 44 deletions

View File

@@ -2,5 +2,5 @@
"server_ip": "192.168.68.118", "server_ip": "192.168.68.118",
"server_port": 3000, "server_port": 3000,
"video_path": "videos/bigbuck.mp4", "video_path": "videos/bigbuck.mp4",
"password": "pass" "password": ""
} }

View File

@@ -63,16 +63,16 @@ socket.addEventListener("message", (event) => {
console.log(`%cGap was ${proposed_time - vid.currentTime}`, 'font-size:12px; color:purple') console.log(`%cGap was ${proposed_time - vid.currentTime}`, 'font-size:12px; color:purple')
if (state.playing){ if (state.playing){
// tolerance while the video is playing
if(gap > PLAYING_THRESH){ if(gap > PLAYING_THRESH){
// tolerance while the video is playing
vid.currentTime = proposed_time vid.currentTime = proposed_time
} }
vid.play() vid.play()
} }
else{ else{
vid.pause() vid.pause()
// condition to prevent an unnecessary seek
if (gap > PAUSED_THRESH){ if (gap > PAUSED_THRESH){
// condition to prevent an unnecessary seek
vid.currentTime = proposed_time vid.currentTime = proposed_time
} }
} }
@@ -142,7 +142,7 @@ function median(values) {
values.sort((x,y) => (x-y)); values.sort((x,y) => (x-y));
let half = Math.floor(values.length / 2); let half = Math.floor(values.length / 2);
if (values.length % 2){ if (values.length % 2) {
return values[half]; return values[half];
} }
return (values[half - 1] + values[half]) / 2.0; return (values[half - 1] + values[half]) / 2.0;

View File

@@ -79,7 +79,6 @@ app.use(session({
resave: false, resave: false,
saveUninitialized: false, saveUninitialized: false,
logged: false logged: false
})); }));
app.get("/", function (req, res) { app.get("/", function (req, res) {

View File

@@ -31,33 +31,3 @@ video {
border-radius: 10px; border-radius: 10px;
border: 2px solid black; border: 2px solid black;
} }
.user-list {
margin-top: 20px;
}
.user-list h2 {
margin-bottom: 10px;
font-size: 1.5rem;
color: #333;
}
.user-list ul {
list-style-type: none;
padding: 0;
}
.user-list li {
margin-bottom: 5px;
padding: 10px;
background-color: #f0f0f0;
border-radius: 5px;
}
.user-list li:hover {
background-color: #e0e0e0;
}
.user-list li:last-child {
margin-bottom: 0;
}

View File

@@ -17,15 +17,6 @@
<source src="/video" type="video/mp4" /> <source src="/video" type="video/mp4" />
</video> </video>
</div> </div>
<div class="user-list">
<h2>People Watching:</h2>
<ul>
<li>User 1</li>
<li>User 2</li>
<li>User 3</li>
<!-- Add more list items for additional users -->
</ul>
</div>
</div> </div>
</body> </body>
</html> </html>