Skip to content

fix: respect caller format and allow opting out of f_auto - #1097

Open
tsi wants to merge 1 commit into
masterfrom
fix/VIDEO-21243-format-opt-out
Open

tsi wants to merge 1 commit into
masterfrom
fix/VIDEO-21243-format-opt-out

Conversation

@tsi

@tsi tsi commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Jira: VIDEO-21243

Why

The player adds f_auto:video to every auto source, and integrators had no way to opt out. A caller's own fetch_format was chained in front of the default (f_mp4/f_auto:video/...) rather than replacing it, and format inside a transformation was silently dropped.

What changed

  • A caller-supplied fetch_format replaces the default f_auto:video, and the source MIME type follows it.
  • format inside a transformation is an alias of fetch_format. If both are set, fetch_format wins.
  • sourceTypes: [''] delivers the asset as-is, with no f_auto:video and no extension. A bare URL resolves and serves the original file.
  • Added getTransformationValue to src/utils/cloudinary.js. isKeyInTransformation now uses it and behaves the same.
Config Before After
default f_auto:video/sea_turtle unchanged
transformation: { fetch_format: 'mp4' } f_mp4/f_auto:video/sea_turtle, video/auto f_mp4/sea_turtle, video/mp4
transformation: { format: 'mp4' } f_auto:video/sea_turtle, video/auto f_mp4/sea_turtle, video/mp4
transformation: { fetch_format: 'auto' } f_auto/f_auto:video/sea_turtle unchanged
sourceTypes: [''] sea_turtle. (broken), video/ sea_turtle, video/auto

The default output is byte-identical. Explicit sourceTypes (mp4, hls, ...) are unaffected.

Not in this PR

  • raw_transformation: 'f_mp4' still gets f_auto:video added.
  • The broader rule-based refactor of the four defaults described in the ticket.
  • Docs for the new behaviour.

Testing

  • New unit tests in test/unit/videoSource.test.js cover caller fetch_format/format and sourceTypes: [''].
  • npm run test:unit passes (141 tests).

A caller-supplied fetch_format (or its format alias) now replaces the
default f_auto:video, with a matching MIME type. An empty source type
delivers the asset as-is, without f_auto:video or an extension.

VIDEO-21243
@tsi
tsi requested a review from a team as a code owner October 14, 2026 08:43
@netlify

netlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cld-vp-esm-pages ready!

Name Link
🔨 Latest commit 7631d76
🔍 Latest deploy log https://app.netlify.com/projects/cld-vp-esm-pages/deploys/6acf40c64deb3eece8bfbf79
😎 Deploy Preview https://deploy-preview-1097--cld-vp-esm-pages.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cld-video-player ready!

Name Link
🔨 Latest commit 7631d76
🔍 Latest deploy log https://app.netlify.com/projects/cld-video-player/deploys/6acf40c60cecc4f0501a8298
😎 Deploy Preview https://deploy-preview-1097--cld-video-player.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
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.

1 participant