Skip to content

Commit

Permalink
possible solution for sending videos to the dashboard after cutting
Browse files Browse the repository at this point in the history
  • Loading branch information
luisdonin committed Jan 24, 2024
1 parent 7da99de commit 8ea59b6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions assets/js/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const ffmpeg = require('fluent-ffmpeg');





app.use('/bootstrap/css/', express.static(path.join(__dirname, '/../bootstrap/css/')));
app.use('/css/',express.static(path.join(__dirname, '/../css/')));
app.use('/img/',express.static(path.join(__dirname, '/../img/')));
Expand Down Expand Up @@ -71,7 +73,7 @@ app.get('/dashboard', (req, res) => {
res.sendFile('dashboard.html', {'root': __dirname + '/../../'});
});


let videos = [];

app.get('/download', async (req,res) => {
const videoURL = req.query.URL;
Expand Down Expand Up @@ -122,6 +124,7 @@ app.get('/download', async (req,res) => {
console.log("Cut finished");
console.log(`Saved to '${cutFilePath}'`);
console.log(`Sending video ${i} to client`)
// video.push(cutFilePath)
res.download(mergedFilePath, videoTitle + '.mp4', (err) => {
if(err === undefined){
console.log("Video sent successfully");
Expand Down Expand Up @@ -150,8 +153,11 @@ app.get('/download', async (req,res) => {
}
});



/*app.get('/dashboard', (req, res) =>{
// Send the video paths to the client
res.json(videos)
})
*/
app.listen(server_settings.port, () => {
console.log(`Server listening at http://${server_settings.hostname}:${server_settings.port}`)
});

0 comments on commit 8ea59b6

Please sign in to comment.