File tree 4 files changed +11
-1
lines changed
4 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2159,6 +2159,7 @@ export type HlsConfig = {
2159
2159
enableSoftwareAES: boolean ;
2160
2160
minAutoBitrate: number ;
2161
2161
ignoreDevicePixelRatio: boolean ;
2162
+ maxDevicePixelRatio: number ;
2162
2163
preferManagedMediaSource: boolean ;
2163
2164
timelineOffset? : number ;
2164
2165
loader: {
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ See [API Reference](https://hlsjs-dev.video-dev.org/api-docs/) for a complete li
21
21
- [ ` capLevelToPlayerSize ` ] ( #capleveltoplayersize )
22
22
- [ ` capLevelOnFPSDrop ` ] ( #caplevelonfpsdrop )
23
23
- [ ` ignoreDevicePixelRatio ` ] ( #ignoredevicepixelratio )
24
+ - [ ` maxDevicePixelRatio ` ] ( #maxdevicepixelratio )
24
25
- [ ` debug ` ] ( #debug )
25
26
- [ ` autoStartLoad ` ] ( #autostartload )
26
27
- [ ` startPosition ` ] ( #startposition )
@@ -526,6 +527,12 @@ This configuration will be applied by default to all instances.
526
527
- when set to true, calculations related to player size will ignore browser ` devicePixelRatio ` .
527
528
- when set to false, calculations related to player size will respect browser ` devicePixelRatio ` .
528
529
530
+ ### ` maxDevicePixelRatio `
531
+
532
+ (default: ` Number.POSITIVE_INFINITY ` )
533
+
534
+ - when set, calculations related to player size will limit the browser's ` devicePixelRatio ` to this specified value.
535
+
529
536
### ` debug `
530
537
531
538
(default: ` false ` )
Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ export type HlsConfig = {
272
272
enableSoftwareAES : boolean ;
273
273
minAutoBitrate : number ;
274
274
ignoreDevicePixelRatio : boolean ;
275
+ maxDevicePixelRatio : number ;
275
276
preferManagedMediaSource : boolean ;
276
277
timelineOffset ?: number ;
277
278
loader : { new ( confg : HlsConfig ) : Loader < LoaderContext > } ;
@@ -356,6 +357,7 @@ export const hlsDefaultConfig: HlsConfig = {
356
357
capLevelOnFPSDrop : false , // used by fps-controller
357
358
capLevelToPlayerSize : false , // used by cap-level-controller
358
359
ignoreDevicePixelRatio : false , // used by cap-level-controller
360
+ maxDevicePixelRatio : Number . POSITIVE_INFINITY , // used by cap-level-controller
359
361
preferManagedMediaSource : true ,
360
362
initialLiveManifestSize : 1 , // used by stream-controller
361
363
maxBufferLength : 30 , // used by stream-controller
Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ class CapLevelController implements ComponentAPI {
258
258
}
259
259
}
260
260
261
- return pixelRatio ;
261
+ return Math . min ( pixelRatio , this . hls . config . maxDevicePixelRatio ) ;
262
262
}
263
263
264
264
private isLevelAllowed ( level : Level ) : boolean {
You can’t perform that action at this time.
0 commit comments