Merged
Conversation
✅ Deploy Preview for cld-video-player ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for cld-vp-esm-pages ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
adimiz1
approved these changes
Mar 9, 2026
Contributor
adimiz1
left a comment
There was a problem hiding this comment.
I learned a lot from this, thanl you!
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aspect ratio & crop mode as top-level source props
Summary
Add
aspectRatio,cropMode, andcropPadColoras top-level source options. The player merges these into the Cloudinary transformation internally, so consumers no longer need to constructtransformation.aspect_ratio,transformation.crop, etc. manually.Changes
API
aspectRatio,cropMode,cropPadColorplayer.source()ordata-cld-source:Crop modes
fillc_fillpadc_pad+backgroundcropPadColorfor backgroundsmartc_fill+g_autoImplementation
normalizeAspectCropin cloudinary plugin: Merges top-level props intotransformationbefore processingsmartmapping: Usesfill+gravity: 'auto'(instead offill_pad) to avoid distortion withaspect_ratioFiles touched
src/video-player.const.jssrc/plugins/cloudinary/index.jsnormalizeAspectCropmerge logicsrc/config/configSchema.jsonaspectRatio,cropMode,cropPadColorsrc/validators/validators.jssrc/utils/get-analytics-player-options.jsdocs/aspect-ratio-crop.htmldocs/es-modules/aspect-ratio-crop.htmldocs/index.htmldocs/es-modules/index.htmltest/unit/videoSource.test.jstest/e2e/*Example pages
Testing
pnpm test:unit(videoSource extracts aspectRatio, cropMode, cropPadColor)pnpm test:e2e(NonESM + ESM aspect-ratio-crop page)