
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
sharelib-streamer
Advanced tools
Fork of Andrew Weeks's VidStreamer.js used for streaming Video & Audio.
This is a fork of VidStreamer used to streams Video and Audio files. Config files has been externalized to be merge in a common dir with Sharelib config
VidStreamer.js: A simple streamer for Flash and other videos (and other files too). Supports HTTP pseudostreaming and works with JW Player's bitrate switching.
To make a standalone video streamer, try something like this
var http = require("http");
var vidStreamer = require("vid-streamer");
var app = http.createServer(vidStreamer);
app.listen(3000);
console.log("VidStreamer.js up and running on port 3000");
And here's an example of including it in an Express app
var app = require("express").createServer();
var vidStreamer = require("vid-streamer");
app.get("/videos/", vidStreamer);
app.listen(3000);
If you want to pass in the settings instead via your app, try this (thanks to Will Laurance). Settings given will be merged with the defaults (see below), so you don't need to supply them all.
var http = require("http");
var vidStreamer = require("vid-streamer");
var newSettings = {
rootPath: "download-clips/",
forceDownload: true
}
var app = http.createServer(vidStreamer.settings(newSettings));
app.listen(3000);
You should be able to get it via npm install vid-streamer, or otherwise through Git of course.
There are a few things to twiddle in /config/vidStreamer.json. (Please rename vidStreamer-sample.json.)
Standalone example
{
"mode": "development",
"forceDownload": false,
"random": false,
"rootFolder": "/path/to/videos/",
"rootPath": "videos/",
"server": "VidStreamer.js/0.1.4"
}
Example for Express. (Note that rootPath should be relative to the root URL of your Express app.)
{
"mode": "development",
"forceDownload": false,
"random": false,
"rootFolder": "/path/to/express/public/",
"rootPath": "",
"server": "VidStreamer.js/0.1.4"
}
You can use VidStreamer to serve up random files instead of the actual file requested. This can be useful if you're demoing an app that's supposed to have hundreds of videos but you don't want to go to the trouble of making them all.
I hadn't really thought about how to write video streamer before, so Devendra Tewari's post and the xmoovStream Server source were very useful to me.
Copyright © 2012 Andrew Weeks http://meloncholy.com
VidStreamer.js is licensed under the MIT licence.
I have a website and a Twitter thingy. Please come and say hi if you'd like; be lovely to hear from you.
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.