feat(showcase): optimize CivitAI media URLs for better performance

- Add CivitAI URL utility with optimization strategies for showcase and thumbnail modes
- Replace /original=true with /optimized=true for showcase videos to reduce bandwidth
- Remove redundant crossorigin and referrerpolicy attributes from video elements
- Use media type detection to apply appropriate optimization (image vs video)
- Integrate URL optimization into showcase rendering for improved loading times
This commit is contained in:
Will Miao
2026-03-02 14:05:44 +08:00
parent bde11b153f
commit b72cf7ba98
4 changed files with 305 additions and 6 deletions

View File

@@ -26,8 +26,7 @@ export function generateVideoWrapper(media, heightPercent, shouldBlur, nsfwText,
</button>
` : ''}
${mediaControlsHtml}
<video controls autoplay muted loop crossorigin="anonymous"
referrerpolicy="no-referrer"
<video controls autoplay muted loop
data-local-src="${localUrl || ''}"
data-remote-src="${remoteUrl}"
data-nsfw-level="${nsfwLevel}"