youtube-background-pwa icon indicating copy to clipboard operation
youtube-background-pwa copied to clipboard

Add support for 206 partial content

Open alhoo opened this issue 2 years ago • 1 comments

Current implementation pushes the whole video in one request. This can be problematic in many serverless environments, due to payload size limitations.

Using the 206 partial content http responses we could allow unlimited video size. The video player is able to handle 206 responses which makes them very suitable for our use case.

The core idea is to check if the response size is larger than a limit (for example 1MB) and only return content up to that limit. The server must also indicate that it is a 206 partial content and set the Content-range headers accordingly. This will cause the client to ask for more content using the Range header. Server must also then handle the Range selection correctly.

alhoo avatar Mar 09 '22 06:03 alhoo

this is very interesting yet I've never implemented such a thing. Would you mind opening a pr to at least provide a POC of this?

giacomocerquone avatar Mar 09 '22 09:03 giacomocerquone