2

Background: I'm developing a custom video players in JS to stream MP4 Files using multiple-TCP connections (HTTP/1.1), the reason I'm doing this is because on networks with high latency a single TCP connection provide less bandwidth but by using multiple-TCP connections we can increase the bandwidth (just like how download managers speed up downloading under certain network conditions, like high latency, traffic congestion etc). The only difference between this player and a download managers is that, the player downloads the video in multiple small chunks (1MB/2MB) sequentially, appends the downloaded chunks and play the video, when new chunks are downloaded the are appended to the video.

Problem: I've successfully created the player, however I'm having trouble implementing seek function, I've no way to tell which range-bytes to request when the user seeks the video to a timestamp which is not yet downloaded, I don't want to use a 3rd party library, any help would be appreciated.

Thanks.

  • `video` tag does it automatically when `206` response status is returned https://blog.logrocket.com/build-video-streaming-server-node/ – Konrad Oct 14 '22 at 19:17
  • Also, browsers don't know, the server returns which bytes were sent last time and asks for more. – Konrad Oct 14 '22 at 19:36
  • Does this answer your question? [How can HTML5 video's byte-range requests (pseudo-streaming) work?](https://stackoverflow.com/questions/18178374/how-can-html5-videos-byte-range-requests-pseudo-streaming-work) – metatoaster Oct 15 '22 at 06:19
  • 1
    @Konrad there must be some algorithm behind the automation right? also, you mentioned browser don't know, but when we seek a video from say 1:00 to 6:00 the browser will create a new request to the server with range-bytes for 6:00 onward, where to those ranges come from? – Kaleem Ullah Nov 25 '22 at 17:34
  • 1
    https://stackoverflow.com/questions/18178374/how-can-html5-videos-byte-range-requests-pseudo-streaming-work – Konrad Nov 25 '22 at 17:41

0 Answers0