Node.js Media Server / VOD / HLS / DRM
git clone https://github.com/gkozlenko/node-media-server.git
cd node-media-server
npm install
Config is located in the config/index.js
file.
const config = {
// Host and port for bidding
host: '0.0.0.0',
port: 3000,
// Path to static files
publicPath: path.resolve('./public'),
// Path to video files
mediaPath: path.resolve('./media'),
// Path to index files
indexPath: path.resolve('./index'),
// Path to log files
logsPath: path.resolve('./logs'),
// Video chunk duration
fragmentDuration: 10,
// DRM configuration
drmEnabled: false,
drmSeed: 'DRM SEED',
// Logger configuration
logLevel: intel.DEBUG,
logSize: '50m',
logKeep: 10,
shutdownInterval: 1000,
workers: {
// Server Worker
web: {
enabled: true,
count: require('os').cpus().length,
shutdownTimeout: 5000,
},
// Movie indexer Worker
indexer: {
enabled: true,
count: 1,
timeout: 5000,
},
},
};
npm start
Use such URL to play a video file using HLS protocol:
http://host:port/vod/FILE_NAME/playlist.m3u8