cloudinary-community / cloudinary-util

https://cloudinary-util.vercel.app
MIT License
12 stars 19 forks source link

[Feature] Add top level rawTransformations option to getVideoPlayerOptions #201

Open colbyfayock opened 2 months ago

colbyfayock commented 2 months ago

Feature Request

Is your feature request related to a problem? Please describe.

A goal of the CldVideoPlayer is to move to a more consistent transformation API similar to the CldImage component.

One first step, based on request, is to create a rawTransformations mechanism which is an escape hatch for people to write whatever transformation they want in the raw URL format.

Usage would appear like:

<CldVideoPlayer rawTransformations={['w_100,h_900,c_fill', 'w_900,h_900,c_pad,b_blue']} />

To make this work, the Cloudinary Video Player exposes a transformation option which itself has a raw_transformation property.

https://github.com/cloudinary/js-url-gen/blob/master/src/types/types.ts#L433

We can utilize this to pass along any raw transformations to that property.

This should be handled from within the getVideoPlayerOptions function to allow all libraries to get this feature support.

Note: as someone could pass in both rawTransformations and transformation.raw_transformations, we should merge the values of those two fields to avoid conflicts and allow them to work together, even though it may not be recommended as such.

Related: https://github.com/nuxt-modules/cloudinary/issues/239