HLS Streaming using node JS HLS Streaming using node JS node.js node.js

HLS Streaming using node JS


With the idea from Brad, I was able to do this using express.static. Here goes the solution.

The app.js is changed like this

var express = require('express');var app = express();var path = require('path');app.use(express.static(path.join(__dirname,'streamcontent')));app.listen(8000);console.log('Listening on Port 8000');

and the .m3u8 playlist changed to this

#EXTM3U#EXT-X-VERSION:3#EXT-X-MEDIA-SEQUENCE:0#EXT-X-ALLOW-CACHE:YES#EXT-X-TARGETDURATION:19#EXT-X-PLAYLIST-TYPE:VOD#EXTINF:12.595922,http://localhost:8000/segment0.ts#EXTINF:10.135133,http://localhost:8000/segment1.ts#EXTINF:11.511511,http://localhost:8000/segment2.ts

And thats it. Voila !!!