mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix(html): remove redundant CDN CSS files and inline background skin styles (#1071)
This commit is contained in:
@@ -4,23 +4,20 @@ import { generateCdnCode } from '../cdn-code';
|
||||
describe('generateCdnCode', () => {
|
||||
it('generates video preset CDN tags for html5-video', () => {
|
||||
expect(generateCdnCode('default-video', 'video', 'html5-video')).toEqual(
|
||||
`<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/video.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/video.css" />`
|
||||
`<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/video.js"></script>`
|
||||
);
|
||||
});
|
||||
|
||||
it('includes hls media bundle when renderer is hls', () => {
|
||||
expect(generateCdnCode('default-video', 'minimal-video', 'hls')).toEqual(
|
||||
`<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/video-minimal.js"></script>
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/media/hls-video.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/video-minimal.css" />`
|
||||
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/media/hls-video.js"></script>`
|
||||
);
|
||||
});
|
||||
|
||||
it('generates background preset CDN tags', () => {
|
||||
expect(generateCdnCode('background-video', 'video', 'background-video')).toEqual(
|
||||
`<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/background.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/background.css" />`
|
||||
`<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/html/cdn/background.js"></script>`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,6 +27,5 @@ export function generateCdnCode(useCase: UseCase, skin: Skin, renderer: Renderer
|
||||
scriptLines.push(`<script type="module" src="${CDN_BASE}/media/${mediaSubpath}.js"></script>`);
|
||||
}
|
||||
|
||||
return `${scriptLines.join('\n')}
|
||||
<link rel="stylesheet" href="${CDN_BASE}/${name}.css" />`;
|
||||
return scriptLines.join('\n');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user