diff options
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`); +} |
