@@ -17,11 +17,8 @@ import { DEFAULT_DPR, RENDITIONS } from './models/video-source/video-source.cons
1717
1818import recommendationsOverlay from 'components/recommendations-overlay' ;
1919
20- /**
21- * Effective DPR for breakpoints: min(user value, device DPR, cap of DEFAULT_DPR).
22- */
23- export const getEffectiveDpr = ( userDpr , deviceDpr ) =>
24- Math . min ( userDpr ?? DEFAULT_DPR , deviceDpr ?? DEFAULT_DPR , DEFAULT_DPR ) ;
20+ export const getEffectiveDpr = ( maxDpr , deviceDpr ) =>
21+ Math . min ( maxDpr ?? DEFAULT_DPR , deviceDpr ?? DEFAULT_DPR , DEFAULT_DPR ) ;
2522
2623const DEFAULT_PARAMS = {
2724 transformation : { } ,
@@ -153,13 +150,13 @@ class CloudinaryContext {
153150 { hasUserPosterOptions : hasUserPosterOptions || null }
154151 ) ;
155152
156- // Calculate breakpoint transformation: requiredWidth = playerWidth * dpr , then closest breakpoint as width (no dpr in transformation).
153+ // Calculate breakpoint transformation: requiredWidth = playerWidth * effectiveDpr , then closest breakpoint as width (no dpr in transformation).
157154 if ( options . breakpoints ) {
158155 const playerEl = this . player . el ( ) ;
159156 const playerWidth = playerEl ?. clientWidth ;
160157 const win = playerEl ?. ownerDocument ?. defaultView ;
161158 const deviceDpr = win ?. devicePixelRatio ?? DEFAULT_DPR ;
162- const dpr = getEffectiveDpr ( options . dpr , deviceDpr ) ;
159+ const dpr = getEffectiveDpr ( options . maxDpr , deviceDpr ) ;
163160 const requiredWidth = playerWidth * dpr ;
164161 const width = RENDITIONS . find ( rendition => rendition >= requiredWidth ) || RENDITIONS [ RENDITIONS . length - 1 ] ;
165162 options . breakpointTransformation = {
0 commit comments