File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -404,22 +404,19 @@ class CloudinaryContext {
404404 posterOpts . transformation . crop = 'scale' ;
405405 }
406406
407- // Skip when source already has sizing from breakpoints/aspectRatio.
408- const sourceHasSizing = isKeyInTransformation ( sourceOpts . transformation , 'width' ) ||
409- isKeyInTransformation ( sourceOpts . transformation , 'aspect_ratio' ) ;
407+ // Skip when source already has width (e.g. breakpoints).
408+ const sourceHasSizing = isKeyInTransformation ( sourceOpts . transformation , 'width' ) ;
410409 const playerEl = this . player . el ( ) ;
411410 if (
412411 ! sourceHasSizing &&
413- playerEl ?. clientWidth &&
414- playerEl ?. clientHeight
412+ playerEl ?. clientWidth
415413 ) {
416414 const roundUp100 = ( val ) => 100 * Math . ceil ( val / 100 ) ;
417415 const dpr = getEffectiveDpr ( sourceOpts . maxDpr ) ;
418416
419417 posterOpts . transformation = mergeTransformations ( posterOpts . transformation , {
420418 width : roundUp100 ( playerEl . clientWidth * dpr ) ,
421- height : roundUp100 ( playerEl . clientHeight * dpr ) ,
422- crop : 'limit'
419+ ...( ! isKeyInTransformation ( posterOpts . transformation , 'crop' ) && { crop : 'limit' } )
423420 } ) ;
424421 }
425422
You can’t perform that action at this time.
0 commit comments