Added video-sync for clients. Tweaked the code.

Moved the script for index.html (the home page) to client.js
Created a new directory for videos: /videos
Added a new video: /videos/Shreksophone_Original.mp4
Moved bigbuck.mp4 to /videos
Added the video-sync clinet code to client.js
Added the video-sync client code to index.js
Updated index.html inner html to work with the vidoe-sync
This commit is contained in:
ShakedAp
2023-06-24 21:42:11 +03:00
parent d00e6e04ff
commit 828697aa68
5 changed files with 242 additions and 18 deletions

View File

@@ -3,22 +3,15 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script defer type="text/javascript" src="client.js"></script>
<title>Client</title>
</head>
<body>
Client page!
<br/>
<video id="videoPlayer" width="650" controls disablePictureInPicture controlsList="nodownload" autoplay>
<video id="videoPlayer" width="650" controls disablePictureInPicture controlsList="nodownload noplaybackrate" muted>
<source src="/video" type="video/mp4" />
</video>
</body>
<script>
// Create WebSocket connection.
const socket = new WebSocket('ws://localhost:3000');
// Connection opened
socket.addEventListener('open', function (event) {
console.log('Connected to WS Server')
});
</script>
</html>