Video Streaming Api Nodejs 90%

app.get('/video/:filename', (req, res) => { const filename = req.params.filename; const filePath = path.join(__dirname, 'videos', filename);

const stat = fs.statSync(filePath); const fileSize = stat.size; const range = req.headers.range; video streaming api nodejs

// Check if file exists if (!fs.existsSync(filePath)) { return res.status(404).send('Video not found'); } { const filename = req.params.filename

Lane Mello
Fundador e Editor da Fatos Militares. Jovem mineiro, apaixonado por História, futebol e Games, Dedica seu tempo livre para fazer matérias ao site.

Poder Naval: Navios de Guerra da Marinha do Brasil

Previous article

O Cerco de Jadotville: a verdadeira história da batalha

Next article

Comments

Comments are closed.