Stream videos from a public directory hosted on your server directly into VLC media player using Node.js.
-
Automatically fetch and list video links hosted on your server.
-
Stream videos one by one in VLC player.
-
Easily start or continue from any video.
- Open the URL of the directory in browser.
- Open
getVideoUrls.jsand copy the code and paste in browser console. - It’ll give you an array of video links. Just copy that.
Open links.js and paste the copied video URLs array there.
Example content of links.js:
const videoUrls = [
"http://your-vps-server.com/videos/video1.mp4",
"http://your-vps-server.com/videos/video2.mp4",
// ...other video URLs
];Open the terminal and run this command:
npm run startThis will open VLC and start streaming the videos one after another.
If you want to resume from a particular video (say the 3rd one), just change the index value in the video.js file.
Next, we’ll automate video link fetching using Puppeteer, so URLs will be scraped directly from public directories without manual copy-pasting.