video-stream
v1.2.1
Published
Video stream middleware for express/Node.js
Downloads
18
Readme
video-stream
Express middleware for streaming video.
Installation
npm install -S video-stream
Usage
Call videoStream
middleware passing the directory that we should look for videos.
const path = require('path')
const express = require('express')
const videoStream = require('video-stream')
const app = express()
// video-stream route
app.get('/video/:filename', videoStream({ dir: path.resolve(__dirname) }))
// Your normal routes
app.get('/', (req, res) => {
res.send('Hello World')
res.end()
})
app.listen(3000, () => {
console.log(`Listening on port 3000`)
})
Check a working example on example folder.
caiogondim.com · GitHub @caiogondim · Twitter @caio_gondim