Repository navigation
fix(service-worker): update service worker to handle seeking better for videos . - #60007
Beanminchild wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…or videos This update ensures that the service worker can handle range requests, allowing video seeking to work correctly when videos are delivered by the service worker.
|
Apologies, Linting failed because i didn't follow naming conventions for commit message |
|
I don't think this is what's required for #25865. The change made here is updating example code that is just meant to "mock" out the service worker without functionality. I'm going to close this since the change doesn't seem right to me. |
|
ah okay i was following a suggestion in the comments. i can dig deeper into the project structure and try a more correct solution... ill make sure to do more verification before i open any other prs so i dont spam. Thanks for the feedback |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #25865
What is the new behavior?
1.) Fetch Event Listener: The service worker listens for fetch events and checks if the request contains a range header.
2.) Range Request Handling: If a range header is present, the service worker calls the handleRangeRequest function to process the request.
3.) Partial Content Response: The handleRangeRequest function extracts the requested byte range from the range header, retrieves the requested resource from the cache, slices the resource to the specified byte range, and returns a 206 Partial Content response with the appropriate Content-Range header.
This ensures that video seeking works correctly when videos are delivered by the service worker.
Does this PR introduce a breaking change?
I saw this problem was a bit of a necro thread thats been an issue for quite some time. There was a workaround in the chat that did something similar to what im doing here but i figured it would be nice if this logic was just built in instead of people needing to implement a third party hack. Based on my local testing this should work as expected but please feel free to give me any feedback, concerns or needed improvements and ill be happy to implement them to get this bug fix finally squared away :)