Skip to content

fix: keep 7.0.0 CldVideoPlayer URLs when aspectRatio is used with a transformation or cropMode - #676

Merged
PaulBoye-py merged 1 commit into
mainfrom
fix/video-player-aspect-ratio-transformation
Nov 17, 2026
Merged

PaulBoye-py merged 1 commit into
mainfrom
fix/video-player-aspect-ratio-transformation

Conversation

@PaulBoye-py

@PaulBoye-py PaulBoye-py commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes a regression in 7.1.0 (#674). CldVideoPlayer with aspectRatio plus a transformation object or cropMode could deliver a different video than 7.0.0, or fail to play. Those players now get exactly their 7.0.0 URLs again. The poster fix from #674 is kept where it's needed.

Cause

#674 merged the transformation into one URL step whenever aspectRatio was set, so the player added ar_ to the same step as the user's resize, crop, overlay or g_auto. The poster bug only happens when the player's ar_ step is on its own, which is when there's no cropMode and no transformation.

Change

getPlayerTransformation merges only when aspectRatio is set, there's no cropMode, and the array from getVideoPlayerOptions holds nothing but its own quality step. Everything else is passed through unchanged, as in 7.0.0. The tests now cover 16 transformation shapes (each alone, with cropMode and with quality), every cropMode, {}, [], the quality prop and the poster props.

Results

Real players in Chrome, 37 cases × 2 videos (9:16 and 4:3), on 7.0.0, 7.1.0 and this branch. Same as 7.0.0 in 74/74 rows; no poster fails where 7.0.0 loaded it.

aspectRatio="16:9" with 7.0.0 7.1.0 This PR
nothing, {}, [], quality prop poster 400 poster loads (except []) poster loads, same video as 7.0.0
object with width/height alone, crop, own aspect_ratio poster 400 video resized (e.g. 500×888 → 500×280) identical to 7.0.0
object with text overlay or crop + gravity: auto plays fails (400) identical to 7.0.0
{ effect }, { quality }, { width, height, crop: "fill" } poster 400 poster loads identical to 7.0.0 (poster 400 again)
cropMode fill/pad plays, poster loads merged; one case resized identical to 7.0.0
cropMode="smart" plays fails (400) identical to 7.0.0
custom poster (string or object) poster loads poster loads poster loads, same video as 7.0.0
arrays, { width, height } poster 400 same video, poster 400 identical to 7.0.0

Players without aspectRatio have the same URLs in all three versions.

pnpm test 77/77 (54 of the 61 player tests fail on the 7.1.0 code), pnpm test:app passes.

Trade-off

Compared with 7.1.0, the poster fails again for aspectRatio + a transformation object without cropMode, as in 7.0.0, including { effect }, { quality } and { width, height, crop: "fill" }. Workarounds (tested): cropMode="pad" with cropPadColor="black" (whole video with bars), or cropMode="fill" (crops to the aspect ratio). A proper fix is tracked in #675.

Not tested: other aspect ratios, widths/DPR, browsers, the player's breakpoints option, streaming profiles.

Full comparison table (37 cases)

Sizes are 9:16 · 4:3 video, or once when both are the same.

Case Props (with aspectRatio="16:9") 7.0.0 video 7.0.0 poster 7.1.0 video 7.1.0 poster Fix video Fix poster Fix same as 7.0.0
A1-none (none) 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ ✅ same video
A2-effect transformation={{ effect: "sepia" }} 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ❌ 400 ✅ same URLs
A3-w transformation={{ width: 500 }} 500×888 · 500×374 ❌ 400 500×280 ❌ 400 500×888 · 500×374 ❌ 400 ✅ same URLs
A3-h transformation={{ height: 500 }} 280×500 · 666×500 ❌ 400 888×500 ✅ 280×500 · 666×500 ❌ 400 ✅ same URLs
A3-wh transformation={{ width: 500, height: 500 }} 500×500 ❌ 400 500×500 ❌ 400 500×500 ❌ 400 ✅ same URLs
A4-w-fill transformation={{ width: 500, crop: "fill" }} 500×888 · 500×374 ❌ 400 500×280 ✅ 500×888 · 500×374 ❌ 400 ✅ same URLs
A4-w-scale transformation={{ width: 500, crop: "scale" }} 500×888 · 500×374 ❌ 400 500×280 ✅ 500×888 · 500×374 ❌ 400 ✅ same URLs
A4-w-limit transformation={{ width: 500, crop: "limit" }} 500×888 · 500×374 ❌ 400 158×280 · 374×280 ✅ 500×888 · 500×374 ❌ 400 ✅ same URLs
A4-w-pad transformation={{ width: 500, crop: "pad" }} 500×888 · 500×374 ❌ 400 500×282 ✅ 500×888 · 500×374 ❌ 400 ✅ same URLs
A4-w-fit transformation={{ width: 500, crop: "fit" }} 500×888 · 500×374 ❌ 400 158×280 · 374×280 ✅ 500×888 · 500×374 ❌ 400 ✅ same URLs
A4-w-crop transformation={{ width: 500, crop: "crop" }} 500×888 · 500×374 ❌ 400 500×280 ✅ 500×888 · 500×374 ❌ 400 ✅ same URLs
A4-wh-fill transformation={{ width: 500, height: 500, crop: "fill" }} 500×500 ❌ 400 500×500 ✅ 500×500 ❌ 400 ✅ same URLs
A5-crop transformation={{ crop: "fill" }} 1080×1920 · 1440×1080 ❌ 400 1080×608 · 1440×810 ✅ 1080×1920 · 1440×1080 ❌ 400 ✅ same URLs
A5-crop-g transformation={{ crop: "fill", gravity: "auto" }} 1080×1920 · 1440×1080 ❌ 400 ❌ fails ✅ 1080×1920 · 1440×1080 ❌ 400 ✅ same URLs
A6-own-ar transformation={{ aspect_ratio: "1:1", crop: "fill" }} 1080×1080 ❌ 400 1080×608 · 1440×810 ✅ 1080×1080 ❌ 400 ✅ same URLs
A7-quality transformation={{ quality: 50 }} 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ❌ 400 ✅ same URLs
A8-overlay transformation={{ overlay: "text:Arial_80:Hello", gravity: "south", y: 40, color: "white" }} 1080×1920 · 1440×1080 ❌ 400 ❌ fails ✅ 1080×1920 · 1440×1080 ❌ 400 ✅ same URLs
B1-arr-effect transformation={[{ effect: "sepia" }]} 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ❌ 400 ✅ same URLs
B2-arr-w transformation={[{ width: 500 }, { effect: "sepia" }]} 500×888 · 500×374 ❌ 400 500×888 · 500×374 ❌ 400 500×888 · 500×374 ❌ 400 ✅ same URLs
C1-cm-fill cropMode="fill" 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ ✅ same URLs
C2-cm-w cropMode="fill" transformation={{ width: 500 }} 500×280 ✅ 500×280 ✅ 500×280 ✅ ✅ same URLs
C3-cm-effect cropMode="fill" transformation={{ effect: "sepia" }} 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ ✅ same URLs
D1-noar-w no aspectRatio, transformation={{ width: 500 }} 500×888 · 500×374 ✅ 500×888 · 500×374 ✅ 500×888 · 500×374 ✅ ✅ same URLs
D2-noar-overlay no aspectRatio, transformation={{ overlay: … }} (as A8) 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ ✅ same URLs
E1-empty-obj transformation={{}} 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ ✅ same video
E2-empty-arr transformation={[]} 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ✅ ✅ same video
F2-cm-pad cropMode="pad" 3414×1920 · 1920×1080 ✅ 3414×1920 · 1920×1080 ✅ 3414×1920 · 1920×1080 ✅ ✅ same URLs
F3-cm-pad-color cropMode="pad" cropPadColor="red" 3414×1920 · 1920×1080 ✅ 3414×1920 · 1920×1080 ✅ 3414×1920 · 1920×1080 ✅ ✅ same URLs
F4-cm-smart cropMode="smart" 1080×606 · 1440×810 ✅ ❌ fails ✅ 1080×606 · 1440×810 ✅ ✅ same URLs
G1-q quality={50} 1080×1920 · 1440×1080 ❌ 400 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ ✅ same video
G2-q-cm quality={50} cropMode="fill" 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ ✅ same URLs
G3-q-w quality={50} transformation={{ width: 500 }} 500×888 · 500×374 ❌ 400 500×280 ❌ 400 500×888 · 500×374 ❌ 400 ✅ same URLs
P1-poster-str poster="https://res.cloudinary.com/demo/image/upload/sample.jpg" 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ ✅ same video
P2-poster-obj poster={{ tint: "equalize:80:blue:blueviolet" }} 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ 1080×1920 · 1440×1080 ✅ ✅ same video
W2-cm-quality-obj cropMode="fill" transformation={{ quality: 50 }} 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ 1080×608 · 1440×810 ✅ ✅ same URLs
W3-cm-wh-fill cropMode="fill" transformation={{ width: 500, height: 500, crop: "fill" }} 500×280 ✅ 500×500 ✅ 500×280 ✅ ✅ same URLs
P3-poster-obj-w poster={{ tint: … }} transformation={{ width: 500 }} 500×888 · 500×374 ✅ 500×280 ✅ 500×888 · 500×374 ✅ ✅ same URLs
URLs for every case (9:16 video)

A1-none

  • 7.0.0: q_auto/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_auto,w_700
  • Fix: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_auto,w_700

A2-effect

  • 7.0.0: q_auto/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,e_sepia,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,e_sepia,q_auto,w_700
  • Fix: q_auto/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9/c_limit,w_700

A3-w

  • 7.0.0: q_auto/w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9
  • 7.1.0: ar_16:9,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,q_auto
  • Fix: q_auto/w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9

A3-h

  • 7.0.0: q_auto/h_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,h_500,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_auto,w_700
  • Fix: q_auto/h_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9/c_limit,w_700

A3-wh

  • 7.0.0: q_auto/h_500,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9
  • 7.1.0: ar_16:9,h_500,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,q_auto
  • Fix: q_auto/h_500,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9

A4-w-fill

  • 7.0.0: q_auto/c_fill,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill,w_500/ar_16:9
  • 7.1.0: ar_16:9,c_fill,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_auto,w_500
  • Fix: q_auto/c_fill,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill,w_500/ar_16:9

A4-w-scale

  • 7.0.0: q_auto/c_scale,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_scale,w_500/ar_16:9
  • 7.1.0: ar_16:9,c_scale,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_scale,q_auto,w_500
  • Fix: q_auto/c_scale,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_scale,w_500/ar_16:9

A4-w-limit

  • 7.0.0: q_auto/c_limit,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_limit,w_500/ar_16:9
  • 7.1.0: ar_16:9,c_limit,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_auto,w_500
  • Fix: q_auto/c_limit,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_limit,w_500/ar_16:9

A4-w-pad

  • 7.0.0: q_auto/c_pad,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_pad,w_500/ar_16:9
  • 7.1.0: ar_16:9,c_pad,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_pad,q_auto,w_500
  • Fix: q_auto/c_pad,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_pad,w_500/ar_16:9

A4-w-fit

  • 7.0.0: q_auto/c_fit,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fit,w_500/ar_16:9
  • 7.1.0: ar_16:9,c_fit,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_fit,q_auto,w_500
  • Fix: q_auto/c_fit,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fit,w_500/ar_16:9

A4-w-crop

  • 7.0.0: q_auto/c_crop,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_crop,w_500/ar_16:9
  • 7.1.0: ar_16:9,c_crop,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_crop,q_auto,w_500
  • Fix: q_auto/c_crop,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_crop,w_500/ar_16:9

A4-wh-fill

  • 7.0.0: q_auto/c_fill,h_500,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill,h_500,w_500/ar_16:9
  • 7.1.0: ar_16:9,c_fill,h_500,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_auto,w_500
  • Fix: q_auto/c_fill,h_500,w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill,h_500,w_500/ar_16:9

A5-crop

  • 7.0.0: q_auto/c_fill/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,c_fill,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_auto,w_700
  • Fix: q_auto/c_fill/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill/ar_16:9/c_limit,w_700

A5-crop-g

  • 7.0.0: q_auto/c_fill,g_auto/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill,g_auto/ar_16:9/c_limit,w_700
  • 7.1.0: (no video URL, player error) · poster ar_16:9,c_fill,g_auto,q_auto,w_700
  • Fix: q_auto/c_fill,g_auto/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/c_fill,g_auto/ar_16:9/c_limit,w_700

A6-own-ar

  • 7.0.0: q_auto/ar_1:1,c_fill/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_1:1,c_fill/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,c_fill,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_auto,w_700
  • Fix: q_auto/ar_1:1,c_fill/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_1:1,c_fill/ar_16:9/c_limit,w_700

A7-quality

  • 7.0.0: q_auto/q_50/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/q_50/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,q_50/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_50,w_700
  • Fix: q_auto/q_50/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/q_50/ar_16:9/c_limit,w_700

A8-overlay

  • 7.0.0: q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/ar_16:9/c_limit,w_700
  • 7.1.0: (no video URL, player error) · poster ar_16:9,c_limit,co_white,g_south,l_text:Arial_80:Hello,q_auto,w_700,y_40
  • Fix: q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/ar_16:9/c_limit,w_700

B1-arr-effect

  • 7.0.0: q_auto/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9/c_limit,w_700
  • 7.1.0: q_auto/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9/c_limit,w_700
  • Fix: q_auto/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9/c_limit,w_700

B2-arr-w

  • 7.0.0: q_auto/w_500/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9
  • 7.1.0: q_auto/w_500/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9
  • Fix: q_auto/w_500/e_sepia/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9

C1-cm-fill

  • 7.0.0: q_auto/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_fill/c_limit,w_700
  • 7.1.0: ar_16:9,c_fill,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_auto,w_700
  • Fix: q_auto/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_fill/c_limit,w_700

C2-cm-w

  • 7.0.0: q_auto/w_500/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_fill
  • 7.1.0: ar_16:9,c_fill,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_auto,w_500
  • Fix: q_auto/w_500/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_fill

C3-cm-effect

  • 7.0.0: q_auto/e_sepia/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9,c_fill/c_limit,w_700
  • 7.1.0: ar_16:9,c_fill,e_sepia,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,e_sepia,q_auto,w_700
  • Fix: q_auto/e_sepia/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/e_sepia/ar_16:9,c_fill/c_limit,w_700

D1-noar-w

  • 7.0.0: q_auto/w_500/f_auto:video/vertical-9x16 · poster q_auto
  • 7.1.0: q_auto/w_500/f_auto:video/vertical-9x16 · poster q_auto
  • Fix: q_auto/w_500/f_auto:video/vertical-9x16 · poster q_auto

D2-noar-overlay

  • 7.0.0: q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/f_auto:video/vertical-9x16 · poster q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/c_limit,w_700
  • 7.1.0: q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/f_auto:video/vertical-9x16 · poster q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/c_limit,w_700
  • Fix: q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/f_auto:video/vertical-9x16 · poster q_auto/co_white,g_south,l_text:Arial_80:Hello,y_40/c_limit,w_700

E1-empty-obj

  • 7.0.0: q_auto/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_auto,w_700
  • Fix: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_auto,w_700

E2-empty-arr

  • 7.0.0: q_auto/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9/c_limit,w_700
  • 7.1.0: q_auto/ar_16:9/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9/c_limit,w_700
  • Fix: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_auto,w_700

F2-cm-pad

  • 7.0.0: q_auto/ar_16:9,c_pad/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_pad/c_limit,w_700
  • 7.1.0: ar_16:9,c_pad,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,c_pad,q_auto,w_700
  • Fix: q_auto/ar_16:9,c_pad/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_pad/c_limit,w_700

F3-cm-pad-color

  • 7.0.0: q_auto/ar_16:9,b_red,c_pad/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,b_red,c_pad/c_limit,w_700
  • 7.1.0: ar_16:9,b_red,c_pad,q_auto/f_auto:video/vertical-9x16 · poster ar_16:9,b_red,c_pad,q_auto,w_700
  • Fix: q_auto/ar_16:9,b_red,c_pad/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,b_red,c_pad/c_limit,w_700

F4-cm-smart

  • 7.0.0: q_auto/ar_16:9,c_fill,g_auto/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_fill,g_auto/c_limit,w_700
  • 7.1.0: (no video URL, player error) · poster ar_16:9,c_fill,g_auto,q_auto,w_700
  • Fix: q_auto/ar_16:9,c_fill,g_auto/f_auto:video/vertical-9x16 · poster q_auto/ar_16:9,c_fill,g_auto/c_limit,w_700

G1-q

  • 7.0.0: q_50/ar_16:9/f_auto:video/vertical-9x16 · poster q_50/ar_16:9/c_limit,w_700
  • 7.1.0: ar_16:9,q_50/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_50,w_700
  • Fix: ar_16:9,q_50/f_auto:video/vertical-9x16 · poster ar_16:9,c_limit,q_50,w_700

G2-q-cm

  • 7.0.0: q_50/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_50/ar_16:9,c_fill/c_limit,w_700
  • 7.1.0: ar_16:9,c_fill,q_50/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_50,w_700
  • Fix: q_50/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_50/ar_16:9,c_fill/c_limit,w_700

G3-q-w

  • 7.0.0: q_50/w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_50/ar_16:9
  • 7.1.0: ar_16:9,q_50,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,q_50
  • Fix: q_50/w_500/ar_16:9/f_auto:video/vertical-9x16 · poster q_50/ar_16:9

P1-poster-str

  • 7.0.0: q_auto/ar_16:9/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/demo/image/upload/sample.jpg
  • 7.1.0: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/demo/image/upload/sample.jpg
  • Fix: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/demo/image/upload/sample.jpg

P2-poster-obj

  • 7.0.0: q_auto/ar_16:9/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/mj3svt4a/video/upload/e_tint:equalize:80:blue:blueviolet/f_auto:image/q_auto/v1/vertical-9x16?_a=BATAXdAA0
  • 7.1.0: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/mj3svt4a/video/upload/e_tint:equalize:80:blue:blueviolet/f_auto:image/q_auto/v1/vertical-9x16?_a=BATAXdAA0
  • Fix: ar_16:9,q_auto/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/mj3svt4a/video/upload/e_tint:equalize:80:blue:blueviolet/f_auto:image/q_auto/v1/vertical-9x16?_a=BATAXdAA0

W2-cm-quality-obj

  • 7.0.0: q_auto/q_50/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/q_50/ar_16:9,c_fill/c_limit,w_700
  • 7.1.0: ar_16:9,c_fill,q_50/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_50,w_700
  • Fix: q_auto/q_50/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/q_50/ar_16:9,c_fill/c_limit,w_700

W3-cm-wh-fill

  • 7.0.0: q_auto/c_fill,h_500,w_500/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/c_fill,h_500,w_500/ar_16:9,c_fill
  • 7.1.0: ar_16:9,c_fill,h_500,q_auto,w_500/f_auto:video/vertical-9x16 · poster ar_16:9,c_fill,q_auto,w_500
  • Fix: q_auto/c_fill,h_500,w_500/ar_16:9,c_fill/f_auto:video/vertical-9x16 · poster q_auto/c_fill,h_500,w_500/ar_16:9,c_fill

P3-poster-obj-w

  • 7.0.0: q_auto/w_500/ar_16:9/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/mj3svt4a/video/upload/e_tint:equalize:80:blue:blueviolet/f_auto:image/q_auto/v1/vertical-9x16?_a=BATAXdAA0
  • 7.1.0: ar_16:9,q_auto,w_500/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/mj3svt4a/video/upload/e_tint:equalize:80:blue:blueviolet/f_auto:image/q_auto/v1/vertical-9x16?_a=BATAXdAA0
  • Fix: q_auto/w_500/ar_16:9/f_auto:video/vertical-9x16 · poster https://res.cloudinary.com/mj3svt4a/video/upload/e_tint:equalize:80:blue:blueviolet/f_auto:image/q_auto/v1/vertical-9x16?_a=BATAXdAA0

…ransformation or cropMode

7.1.0 merged the player transformation into a single step whenever aspectRatio was set, so the player added the aspect ratio to the same step as the user's resize, crop, overlay or g_auto. That changed the delivered video (a width-only transformation was distorted) or made it fail (a text overlay without dimensions, cropMode smart). Only merge when aspectRatio is set without a cropMode and the transformation holds nothing but the quality step from getVideoPlayerOptions, which is when the poster URL would otherwise have an aspect ratio step on its own. Everything else gets its 7.0.0 URLs again.
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
next-cloudinary Ready Ready Preview Nov 13, 2026 7:31pm UTC

Request Review

@strausr strausr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or the 7.1.1 notes, could you cover:

Videos with aspectRatio + a transformation object or cropMode are back to 7.0.0 behaviour (fixes the distortion, overlay and smart failures).
The trade-off: the poster fails again for aspectRatio + a transformation object without cropMode, with the two workarounds (cropMode="pad" + cropPadColor, or cropMode="fill"), and a link to #675.
transformation={[]} now gets the poster fix too.
And once it's out, please update the 7.1.0 known-issue note to say it's fixed in 7.1.1.

transformation: CloudinaryVideoPlayerOptions['transformation']
): CloudinaryVideoPlayerOptions['transformation'] {
if ( props.aspectRatio && !Array.isArray(props.transformation) && Array.isArray(transformation) ) {
if ( props.aspectRatio && !props.cropMode && Array.isArray(transformation) && isQualityOnly(transformation) ) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since aspectRatio alone is the only path whose URLs still differ from 7.0.0, could you do one quick check of it with adaptive streaming (sourceTypes={['hls']}) and on a 2× screen, to confirm the video and poster still load? The rest of the "not tested" list only matters for this path.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for asking for this, it turned up something interesting.

I checked aspectRatio alone, with sourceTypes={['hls']}, and with quality={50} + HLS. I ran each on a 9:16 and a 4:3 video at 1× and 2×, against 7.0.0, 7.1.0 and this PR, plus a control with HLS and no aspectRatio.

  • Without HLS: the video plays in all three versions. With this PR the poster loads at both densities (w_700 at 1×, w_1300 at 2×). Every request (poster, video and seek-thumbnail sprite) is identical to 7.1.0's.
  • With HLS: the poster still loads with this PR, but the video fails in every version, including 7.0.0 and the control without aspectRatio. Cloudinary rejects the sp_auto manifest when the URL has a quality or aspect-ratio setting: q_auto, q_50 and ar_16:9 all return 400 ("sp_auto transformation is not allowed (quality is not supported)" / "(aspect_ratio is not supported)"). url-loader adds a quality step by default (quality defaults to "auto"). A plain sp_auto/<id>.m3u8 returns 200, so HLS itself works on the account.

I also ran the same check on 6.19.3 and got the same error, so this predates v7. HLS isn't affected by this PR, but sourceTypes={['hls']} doesn't seem to play at the moment. I couldn't find an existing issue. Would you like me to open one so we can look at it separately? Thank you!


export function getPlayerTransformation(
props: Pick<CldVideoPlayerProps, 'aspectRatio' | 'transformation'>,
props: Pick<CldVideoPlayerProps, 'aspectRatio'> & { cropMode?: string },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason for & { cropMode?: string } rather than picking cropMode from CldVideoPlayerProps?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no cropMode prop in CldVideoPlayerProps, nor in the @cloudinary-util/types or url-loader types. When I tried Pick<CldVideoPlayerProps, 'aspectRatio' | 'cropMode'>, tsc failed with TS2344 (Type '"aspectRatio" | "cropMode"' does not satisfy the constraint …) and TS2345 in CldVideoPlayer.tsx (Property 'cropMode' is missing in type 'CldVideoPlayerProps'). For the same reason, cropMode="pad" as a JSX prop is a type error today (TS2322), and TypeScript users can spread it in instead, e.g. {...{ cropMode: 'pad' }}.

Adding cropMode and cropPadColor to the public types would be a nice small follow-up. I kept it out of this PR to keep 7.1.1 focused on the regression fix. Happy to open an issue for it if you think it's worth it.

it('should combine the transformation into one object when there is an aspectRatio', () => {
// 7.0.0 passed the transformation from getVideoPlayerOptions to the player unchanged. Merging
// these into one step with the aspectRatio changes the delivered video, so they keep 7.0.0's.
describe.each([

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice coverage, and running the real getVideoPlayerOptions means this would catch a url-loader change too.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Raya. That was the idea, so it's lovely to hear it's useful.

@PaulBoye-py

Copy link
Copy Markdown
Collaborator Author

@strausr, thank you for the reviews;

The 7.1.1 notes now cover all your points:

Once 7.1.1 is out, I'll verify the release and update the 7.1.0 known-issue note to say it's fixed in 7.1.1.

@PaulBoye-py
PaulBoye-py merged commit a7643ba into main Nov 17, 2026
7 checks passed
@PaulBoye-py
PaulBoye-py deleted the fix/video-player-aspect-ratio-transformation branch November 17, 2026 19:55

This branch was successfully deployed

1 active deployment
Preview — 83c7cf7f Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants