Compare commits

..

5 Commits

7 changed files with 56 additions and 24 deletions

View File

@ -1,6 +1,8 @@
{
"server_ip": "0.0.0.0",
"server_port": 3000,
"video_path": "videos/Orb-22.mp4",
"server_port": 8080,
"video_path": "videos/Orb-21.mp4",
"subtitles_path": "videos/Orb-21.vtt",
"bg_path": "videos/bg-20.png",
"password": "password"
}

View File

@ -87,6 +87,7 @@ socket.addEventListener("message", (event) => {
socket.addEventListener('close', function (event) {
console.log('Disconnected from the WS Server');
client_uid = null;
setTimeout(() => window.location.reload(), 1000);
});

BIN
src/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

View File

@ -92,6 +92,13 @@ app.use(session({
logged: false
}));
// disable cache globally because it may break things between server restarts,
// since the paths aren't unique
app.use(function (req, res, next) {
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
next();
});
// home page
app.get("/", function (req, res) {
@ -145,6 +152,7 @@ app.get("/video", function (req, res) {
"Accept-Ranges": "bytes",
"Content-Length": contentLength,
"Content-Type": "video/mp4",
"Cache-Control": "no-cache, no-store, must-revalidate",
};
// HTTP Status 206 for Partial Content
@ -163,7 +171,11 @@ app.get("/video", function (req, res) {
// subtitles track
app.get("/subtitles", function (req, res) {
console.log("hello)");
res.sendFile(__dirname + "/subs/Orb-22.vtt");
res.sendFile(fs.realpathSync(settings.subtitles_path));
});
app.get("/background", function (req, res) {
res.sendFile(fs.realpathSync(settings.bg_path))
});
@ -171,9 +183,19 @@ app.get("/subtitles", function (req, res) {
server.listen(settings.server_port, settings.server_ip,
() => console.log(`Server started at ${settings.server_ip}:${settings.server_port}`));
process.on('SIGINT', () => {
console.log("Shutting down server...");
// wss.close();
wss.clients.forEach(client => client.terminate());
server.close(() => {
console.log("Server closed");
process.exit(0);
});
});
// function to get the current time
function get_time() {
let d = new Date();
return d.getTime();
}
}

View File

@ -8,15 +8,23 @@
}
body {
height: 100vh;
color: aliceblue;
min-height: 100vh;
margin: 0;
padding: 2rem;
background-color: gray;
background-color: #161616;
font-family: "Roboto", sans-serif;
}
body[data-background] {
background-image: url('/background');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-blend-mode: darken;
}
.container {
max-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
@ -25,13 +33,7 @@ body {
header {
text-align: center;
font-size: 2rem;
}
.video-wrapper {
/*position: relative;*/
/*width: 100%;*/
/*padding-bottom: 56.25%;*/
/* 16:9 aspect ratio for responsive video */
text-shadow: aliceblue 0 0 0.25rem;
}
video {

View File

@ -5,21 +5,26 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="main.css">
<script defer type="text/javascript" src="client.js"></script>
<title>Client</title>
<title>Orboverse</title>
<link rel="icon" href="/icon.png" type="image/png">
<!-- Open Graph Meta Tags -->
<meta property="og:title" content="The Orboverse">
<meta property="og:description" content="Join the funny. 🔫.">
<meta property="og:image" content="/stars.jpg">
<meta property="og:url" content="https://anistream.cazzzer.com">
<meta property="og:type" content="website">
</head>
<body>
<body data-background>
<div class="container">
<header>
<h1>Watch-Together</h1>
<h1>Welcome to the Orboverse</h1>
</header>
<div class="video-wrapper">
<video id="videoPlayer" controls controlsList="nodownload noplaybackrate">
<source src="/video" type="video/mp4" />
<video id="videoPlayer" muted controls controlsList="nodownload noplaybackrate">
<source src="/video" type="video/mp4" />
<!-- subtitle track-->
<track kind="subtitles" src="/subtitles" srclang="en" label="English" default>
<p>Your browser does not support the video tag.</p>
</video>
</div>
<track kind="subtitles" src="/subtitles" srclang="en" label="English" default>
<p>Your browser does not support the video tag.</p>
</video>
<div class="subtitle-controls">
<label for="subtitle-size">Subtitle Size: <span id="size-value">1.25em</span></label>
<input type="range" id="subtitle-size" min="0.8" max="2.5" step="0.05" value="1.25">

BIN
src/stars.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB