mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
43acead06d
Follow-up to #69205. After switching adev's COEP to `credentialless`, the cross-origin YouTube iframe in `<docs-video>` loads in Chromium and Safari but not Firefox, whose `credentialless` policy does not extend to nested frames. The result was a COEP error screen instead of the player. Render `<docs-video>` as a lightweight thumbnail facade instead of embedding the iframe directly. The thumbnail is a cross-origin subresource, so it loads under `credentialless` in every browser. `DocViewer` then upgrades the facade to the inline player on hydration in browsers that can load the embed (Chromium, Safari), preserving the previous behavior there. On Firefox the facade stays a plain link that opens the video on YouTube (with autoplay), which replaces the error screen. The thumbnail uses `maxresdefault` and falls back to `hqdefault` when a video has no max-resolution image.