Skip to content

caiogondim/video-stream.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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