2022-01-20
1604
#node
Samuel Martins
87908
Jan 20, 2022 â‹… 5 min read

Build a video streaming server with Node.js

Samuel Martins I am a full-stack developer who loves sharing the knowledge accumulated over the years with people. The different technologies that I have encountered through my journey allows me to relate to beginners and seniors alike. I write about all things tech.

Recent posts:

Comparing Mutative Vs Immer Vs Reducers For Data Handling In React

Comparing React state tools: Mutative vs. Immer vs. reducers

Mutative processes data with better performance than both Immer and native reducers. Let’s compare these data handling options in React.

Rashedul Alam
Apr 26, 2024 â‹… 7 min read
Radix Ui Adoption Guide Overview Examples And Alternatives

Radix UI adoption guide: Overview, examples, and alternatives

Radix UI is quickly rising in popularity and has become an excellent go-to solution for building modern design systems and websites.

Nefe Emadamerho-Atori
Apr 25, 2024 â‹… 11 min read
Understanding The Css Revert Layer Keyword, Part Of Css Cascade Layers

Understanding the CSS revert-layer keyword

In this article, we’ll explore CSS cascade layers — and, specifically, the revert-layer keyword — to help you refine your styling strategy.

Chimezie Innocent
Apr 24, 2024 â‹… 6 min read
Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 â‹… 6 min read
View all posts

9 Replies to "Build a video streaming server with Node.js"

  1. But `express.static()` supports ranged requests out of the box.

    Looks like all you needed was a middleware that rejects non-ranged requests, although that detail seems a bit questionable, as not all browsers use ranged requests to play video.

    (If this was intended as just an exercise, the article probably should explain that.)

  2. Not sure but I I think that if you put a `return` under `res.status(400).send(“Requires Range header”);` you can avoid this error that I get“`Cannot read properties of undefined (reading ‘replace’)
    Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client“` when I try to access directly `/video`

  3. i have try but in mobile client it is not work that use video to receive stream, Is any body else face the same issue like me

  4. Is there a way to stream a camera link (cctv) or network stream (droidcam) instead of a fixed video.

  5. I would like to serve a 10 second .mp4 video, and after the stream completes, I would like to redirect to a static html page. Problem I get is that when video completes, I can’t figure out how to then serve the .html file. I’m trying to do this with the Express package. Is there a way for one node.js file server to serve a .mp4 file then an .html file?

    1. Yes you can use event emitter and emit the ‘end’ event where you can redirect the user to html file.

Leave a Reply