Thanks for the video. It gave me a nice head start. I can see that we are now able to import an async version of stats and use it like so... import { stat } from 'fs/promises'; const {size} = await stat(filename);
In the example I think it makes more sense to do a fs.statsync before starting the server and store the filesize as a global variable, the filesize should never change. On every request he is checking its size, which is not necessary lol
Question! (start - end) for Content-Length returns a negative, shouldnt it be (end-start)? also can you explain why we use size -1 for for end , why do we need to deduct 1 byte?
21:10 you said that you don't do it now. Do you use some modern way to work with streams or it was only about headers? It was a great playlist. Hope to see more advanced-level videos about streams and how do you use them in "real" projects. P.S. Merry Chrismas!
@@WebDevJourney Not at all Sir, it's just that your explanation was much better (relatively) and that's the reason I am watching more and more videos further. I was searching on your channel for the video in which you will be teaching to stream a video that's available online, but didn't found it. It would be very helpful if you can make one soon. :)
This is pretty cool tutorial, can you please make a webcam streaming nodejs server tutorial because it is much more practical and useful than video !!!
You can build one yourself by using WebRTC. Here is a link that can help you get started webrtc.github.io/samples/ if you can not figure it out, then ill try my best to create a video around this topic
@@WebDevJourney I have read that sample codes, it is browser api, not nodejs server, I am talking about server side webcam streamg, it is ok if you dont know, I got the working source codes just it is kinda complicated, a lot of nodesjs api involved ...
True. If you want to actually test if the range headers are working you can add [Content-Disposition: attachment; filename="filename"] header. This will tell your browser to download the file instead of playing it (unless you force it to play it in your browser configurations). If the ranges and sizes don't make sense the download will hang or give you an error. Also it's a good way to test if resumable download is working.
Can you please demonstrate how can we fetch a video from the internet and pipe it th the browser or an endpoint? I'm dying here man I've been looking for ages and I've got nothing. If you can't make a video just give me a code snippet. PLEASE
@@WebDevJourney thank you very much, but what if the file was very large?? That'll consume memory, so how can I pipe it directly to the browser without saving it??
Alright guys, I know this is a long video but I promise you that you will not regret it... or maybe you will.
love the video so informative , well explained with a bit of humour(in the start)
really liked this video, very clear. Makes me wanna play around with this for a side project
please add a series on header also. It would be great help to the developers like me 🤘🏻
Thanks for the video. It gave me a nice head start. I can see that we are now able to import an async version of stats and use it like so...
import { stat } from 'fs/promises';
const {size} = await stat(filename);
In the example I think it makes more sense to do a fs.statsync before starting the server and store the filesize as a global variable, the filesize should never change. On every request he is checking its size, which is not necessary lol
@@soniablanche5672 Makes sense, would consider a refactor 👍
This series was gold!
Thank you very much.
Really nice work... Good concepts explained with simple examples
yes please make a video on headers and how to use them to make better web application , Thank you @Web Dev Journey.
ur channel is seriously underrated
So enjoyable tutorial ! (A little fun)
Question! (start - end) for Content-Length returns a negative, shouldnt it be (end-start)? also can you explain why we use size -1 for for end , why do we need to deduct 1 byte?
21:10 you said that you don't do it now. Do you use some modern way to work with streams or it was only about headers?
It was a great playlist. Hope to see more advanced-level videos about streams and how do you use them in "real" projects.
P.S. Merry Chrismas!
Uffff, vales un billón papi, jajaja thank You bro
Thank you so much!
I learned a lot. Thank you.
I appreciate your explanation more than your voice :)
Did you just say my voice is annoying Or I talk to much?
@@WebDevJourney Not at all Sir, it's just that your explanation was much better (relatively) and that's the reason I am watching more and more videos further. I was searching on your channel for the video in which you will be teaching to stream a video that's available online, but didn't found it. It would be very helpful if you can make one soon. :)
I appreciate this video. Do you have any suggestions on where I can look to stream audio in Nodejs?
Thank you for this great work
This is pretty cool tutorial, can you please make a webcam streaming nodejs server tutorial because it is much more practical and useful than video !!!
You can build one yourself by using WebRTC. Here is a link that can help you get started webrtc.github.io/samples/
if you can not figure it out, then ill try my best to create a video around this topic
@@WebDevJourney I have read that sample codes, it is browser api, not nodejs server, I am talking about server side webcam streamg, it is ok if you dont know, I got the working source codes just it is kinda complicated, a lot of nodesjs api involved ...
@@maskman4821 Honestly I do not know how to do that. Sorry that I couldn't be more of help to you.
Great video. Really helped.
Thanks
thank you very much
"Content-Length" should be {end-start+1} not {start-end+1} . Honestly this confused me a lot .But a really helpful video.
True. If you want to actually test if the range headers are working you can add [Content-Disposition: attachment; filename="filename"] header. This will tell your browser to download the file instead of playing it (unless you force it to play it in your browser configurations). If the ranges and sizes don't make sense the download will hang or give you an error. Also it's a good way to test if resumable download is working.
I subscribed to him
Perfect! One question and how to do readStream from rtmp and then do writeStream to another rtmp? Nodejs does not support rtmp :-(
Good content.
nice
Urgent plz if someone know how to set header range in react native video cant seem to find anything on it, any hepl will be much appreciated.
Content-Length: start-end is allways a negative number isn't it like that?
Can you please demonstrate how can we fetch a video from the internet and pipe it th the browser or an endpoint?
I'm dying here man I've been looking for ages and I've got nothing. If you can't make a video just give me a code snippet. PLEASE
hope this answers your question stackoverflow.com/questions/11944932/how-to-download-a-file-with-node-js-without-using-third-party-libraries
@@WebDevJourney thank you very much, but what if the file was very large?? That'll consume memory, so how can I pipe it directly to the browser without saving it??
@@alihadi7756 well if you wanted to, just pipe it to res. So... "pipe(res)"
@@WebDevJourney thank you very much.
do it with client side rendering its a server side rendering and it not suitable for production
спасибо! ушел писать свой твитч