Skip to content

Conversation

@linxinan-chops
Copy link
Contributor

See original PR: #8342 #8821 #8882

Add cache reader to h5vcc loader to extract the splash video from local storage

With it, youtube main app(www.youtube.com) could cache the splash video into local storage. At the following start, if the cache hits, h5vcc loader will return the local stored video to media source to display.

h5vcc loader exposes two URL parameters for the callers:

fallback: designate the webm file if cache is empty. For now only allow splash_480.webm for the low spec devices.
cache: specify the cache name, default is "default".
Check the h5vcc_scheme_url_loader_factory_browsertest.cc for the expected behaviors.

Issue: 454630524

linxinan-chops and others added 3 commits February 10, 2026 16:19
…vcc schema and move hard coded webm to the embedded file (youtube#7997)

See original youtube#8570:

Register the H5VCC URL schema to the fetch API at render side.

With the change, native splash implementation could call H5VCC to get
the cached contents via fetch API.

In the Cherry pick, I have to refactor a new target for
"//cobalt/shell:url_constants", as in M114 cobalt_shell_lib is still
under "testonly = true", which blocks us to use the constants in
production targets.

Issue: 454630524
…deo from Main app's cache (youtube#8854)

See original PR: youtube#8342
youtube#8821
youtube#8882

Add cache reader to h5vcc loader to extract the splash video from local
storage

With it, youtube main app([www.youtube.com](http://www.youtube.com/))
could cache the splash video into local storage. At the following start,
if the cache hits, h5vcc loader will return the local stored video to
media source to display.

h5vcc loader exposes two URL parameters for the callers:

fallback: designate the webm file if cache is empty. For now only allow
splash_480.webm for the low spec devices.
cache: specify the cache name, default is "default".
Check the h5vcc_scheme_url_loader_factory_browsertest.cc for the
expected behaviors.


Issue: 454630524
@linxinan-chops linxinan-chops requested a review from a team as a code owner February 10, 2026 23:36
@github-actions
Copy link

🤖 Gemini Suggested Commit Message


cobalt: Cache splash video using h5vcc scheme

The h5vcc-embedded URL scheme loader now supports reading splash video
content from the browser's local storage cache. This enables the YouTube
main application to cache splash videos, allowing for quicker display
on subsequent starts by leveraging locally stored content.

The loader attempts to fetch video content from a specified CacheStorage
using URL parameters ("cache" for cache name, "fallback" for built-in
resource). If the cache is empty, content is too large, or reading fails,
it falls back to embedded splash video resources. The h5vcc-embedded
scheme is now registered for Fetch API in renderers.

Issue: 454630524

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables playing the splash video from the main application's cache, implementing a new BlobReader class and enhancing H5vccSchemeURLLoader to interact with the Cache Storage API. However, a medium-severity security vulnerability was identified: the cache query parameter is used from the URL without validation, potentially allowing access to other caches within the same origin. It is recommended to use a hardcoded cache name instead. Additionally, a minor issue was found in the new tests that could lead to flakiness, for which a suggestion has been provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants