-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cap level controller import in cjs build (#1045)
`CapLevelController` doesn't seem to be exported directly in the CJS bundle, https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.js See in https://cdn.jsdelivr.net/npm/@mux/[email protected]/dist/index.cjs.js ```js var ye=require("hls.js"),Z=class Z extends ye.CapLevelController{constructor(t){super(t)}get levels(){var t;return(t=this.hls.levels)!=null?t:[]}getValidLevels(t){return this.levels.filter((r,n)=>this.isLevelAllowed(r)&&n<=t)}getMaxLevel(t){let r=super.getMaxLevel(t),n=this.getValidLevels(t);if(!n[r])return r;let o=Math.min(n[r].width,n[r].height),a=Z.minMaxResolution;return o>=a?r:ye.CapLevelController.getMaxLevelByMediaSize(n,a*(16/9),a)}};Z.minMaxRe ``` <img width="672" alt="SCR-20241217-lobb" src="https://github.com/user-attachments/assets/b0a7ec13-9cca-4726-9cea-8ac71b620a69" />
- Loading branch information
Showing
2 changed files
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters