I am working on a project in which I am creating a video streaming web service. What I have created till now is a service that synchronously write video content into user stream. But, my web service doesn't work the same way Youtube/Netflix work.
I was just wondering how Youtube/Netflix stream videos. These websites don't directly send video content to users' browser. I was looking into networks tabs in developers options and saw that both of these websites make new requests to Web APIs with range header changed. Can anyone please tell me how this works exactly.
In very high level terms, the client (browser, mobile app etc) requests the video from the server.
Because videos are large and users don't want to wait until the whole video has been downloaded to play it back, most clients are designed to start video playback as soon as there is enough of the video for the client to be able to decode and start playback.
Most clients and servers now support at the very least HTTP streaming:
Adaptive Bit rate Streaming builds on this to cater for different network conditions:
You can actually see the ABR effect in YouTube, Netflix etc: when you start a video you will often see the quality is not as good of the first 30seconds to a minute as it steps up the bit rates.
YouTube also has some nice stats which you can access by right clicking the video and checking out 'stats for nerds'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With