/ src / config / hlsjs.ts
hlsjs.ts
 1  declare global {
 2      interface Window {
 3          Hls?: any;
 4      }
 5  }
 6  
 7  /**
 8   * Base URL for CDN hosting HLS.js files
 9   */
10  export const HLSJS_CDN = 'https://js-cdn.music.apple.com/hls.js';
11  
12  /**
13   * HLS.js version to load.
14   */
15  export const HLSJS_VERSION = '2.820.0';
16  
17  /**
18   * Generate a URL for loading HLS.js.
19   */
20  export function generateHLSJSURL(version?: string): URL {
21      // FIXME: Add a local storage override for the HLS.js version
22      version = version ?? HLSJS_VERSION;
23  
24      return new URL(`${HLSJS_CDN}/${version}/hls.js/hls.js`);
25  }