fix(html): remove redundant CDN CSS files and inline background skin styles (#1071)

This commit is contained in:
rahim
2026-03-20 16:50:13 -07:00
committed by GitHub
parent 275aebdc8f
commit 335bda5646
11 changed files with 19 additions and 46 deletions
@@ -8,7 +8,6 @@ export function generateHTMLCode(skin: Skin): string {
const cdnFile = skin === 'default' ? 'video' : 'video-minimal';
return `<script type="module" src="${CDN_BASE}/${cdnFile}.js"></script>
<link rel="stylesheet" href="${CDN_BASE}/${cdnFile}.css" />
<video-player>
<${skinTag}>
@@ -121,15 +121,13 @@ function generateJS(useCase: UseCase, skin: Skin, renderer: Renderer): string {
const mediaImport = mediaSubpath ? `\nimport '@videojs/html/media/${mediaSubpath}';` : '';
return `import '@videojs/html/background/player';
import '@videojs/html/background/skin';
import '@videojs/html/background/skin.css';
import '@videojs/html/background/video';${mediaImport}`;
}
const { group, skinFile } = getSkinImportParts(skin);
const mediaSubpath = getMediaImportSubpath(renderer);
const mediaImport = mediaSubpath ? `\nimport '@videojs/html/media/${mediaSubpath}';` : '';
return `import '@videojs/html/${group}/player';
import '@videojs/html/${group}/${skinFile}';
import '@videojs/html/${group}/${skinFile}.css';${mediaImport}`;
import '@videojs/html/${group}/${skinFile}';${mediaImport}`;
}
export default function HTMLUsageCodeBlock() {