diff --git a/index.js b/index.js index d1f333c..1da7721 100644 --- a/index.js +++ b/index.js @@ -91,7 +91,7 @@ function startVideo(path) { }); } -// fs.mkdirSync('/video', { recursive: true }); +fs.mkdirSync('/video', { recursive: true }); app.post('/play', (req, res) => { if (process) { @@ -125,7 +125,7 @@ app.post('/upload', function (req, res) { // The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file const uploadPath = path.join(__dirname, '/public/videos/'); - req.files.file.mv(uploadPath + req.files.file.name, function (err) { + req.files.file.mv(uploadPath + "video.mp4", function (err) { if (err) { return res.status(500); } diff --git a/video-player.service b/video-player.service index 74b3198..1a55348 100644 --- a/video-player.service +++ b/video-player.service @@ -2,17 +2,13 @@ Description=Video Player After=multi-user.target -StartLimitIntervalSec=500 -StartLimitBurst=50 - [Service] WorkingDirectory=/home/steady/video-player ExecStart=node /home/steady/video-player/index.js Environment=DISPLAY=:0 User=1000 Group=1000 -Restart=on-failure -RestartSec=5s +Restart=always [Install] WantedBy=multi-user.target \ No newline at end of file