DEV Community

Discussion on: How to Code a Video Streaming Server using NodeJS

Collapse
 
prernapahwa profile image
Prerna-Pahwa • Edited

Nice article...but I am unable to stream the video. It's showing just blank with the disabled play button. pls refer the screenshot i attached below.

Collapse
 
omadoyeabraham profile image
omadoyeabraham

@prernapahwa I had a similar issue and the problem for me ended up being that the options object passed to fs.createReadStream as the 2nd parameter requires the keys to be 'start' and 'end'.

So if you renamed the start and end variables from the tutorial (like i did), you'll need to explicitly pass them to the createReadStream call, e.g.

fs.createReadStream(videoPath, { start: STARTING_BYTE_POSITION, end: FINAL_BYTE_POSITION });
Enter fullscreen mode Exit fullscreen mode

NB: STARTING_BYTE_POSITION and FINAL_BYTE_POSITION are the names of my own variables, you'll need to replace them with yours.

I also noticed that typos in headers also caused the blank video player error you described. Hope this helps.