diff options
| author | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
|---|---|---|
| committer | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
| commit | bce557cc2dc767628bed6aac87301a1be7c5431b (patch) | |
| tree | b51a051228d01fe3306cd7626d4a96768aadb944 /src/config/hlsjs.ts | |
init commit
Diffstat (limited to 'src/config/hlsjs.ts')
| -rw-r--r-- | src/config/hlsjs.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/config/hlsjs.ts b/src/config/hlsjs.ts new file mode 100644 index 0000000..0551d94 --- /dev/null +++ b/src/config/hlsjs.ts @@ -0,0 +1,25 @@ +declare global { + interface Window { + Hls?: any; + } +} + +/** + * Base URL for CDN hosting HLS.js files + */ +export const HLSJS_CDN = 'https://js-cdn.music.apple.com/hls.js'; + +/** + * HLS.js version to load. + */ +export const HLSJS_VERSION = '2.820.0'; + +/** + * Generate a URL for loading HLS.js. + */ +export function generateHLSJSURL(version?: string): URL { + // FIXME: Add a local storage override for the HLS.js version + version = version ?? HLSJS_VERSION; + + return new URL(`${HLSJS_CDN}/${version}/hls.js/hls.js`); +} |
