Skip to content

Commit 9b50681

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/next-cloudinary/cloudinary-util/url-loader-5.10.5
2 parents 6d2d8f8 + cf3ddae commit 9b50681

File tree

11 files changed

+178
-70
lines changed

11 files changed

+178
-70
lines changed

.all-contributorsrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,24 @@
281281
"contributions": [
282282
"doc"
283283
]
284+
},
285+
{
286+
"login": "DevRish",
287+
"name": "Rishav Chattopadhyay",
288+
"avatar_url": "https://avatars.githubusercontent.com/u/78094670?v=4",
289+
"profile": "https://github.com/DevRish",
290+
"contributions": [
291+
"doc"
292+
]
293+
},
294+
{
295+
"login": "Prathamesh010",
296+
"name": "Prathamesh Gawas",
297+
"avatar_url": "https://avatars.githubusercontent.com/u/41731424?v=4",
298+
"profile": "https://github.com/Prathamesh010",
299+
"contributions": [
300+
"doc"
301+
]
284302
}
285303
],
286304
"contributorsPerLine": 7,

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [6.14.2](https://github.com/cloudinary-community/next-cloudinary/compare/v6.14.1...v6.14.2) (2024-10-14)
2+
3+
4+
### Bug Fixes
5+
6+
* use more proper type to derive `CldVideoPlayerProps` ([#537](https://github.com/cloudinary-community/next-cloudinary/issues/537)) ([65c3dd1](https://github.com/cloudinary-community/next-cloudinary/commit/65c3dd199176cd91d43161289672381b8c640b68))
7+
18
## [6.14.1](https://github.com/cloudinary-community/next-cloudinary/compare/v6.14.0...v6.14.1) (2024-10-04)
29

310

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ pnpm test
203203
<tr>
204204
<td align="center" valign="top" width="14.28%"><a href="http://yashmathur.live"><img src="https://avatars.githubusercontent.com/u/69838816?v=4?s=100" width="100px;" alt="Yash Mathur"/><br /><sub><b>Yash Mathur</b></sub></a><br /><a href="https://github.com/cloudinary-community/next-cloudinary/commits?author=Yash-sudo-web" title="Code">💻</a></td>
205205
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mr-loop-1"><img src="https://avatars.githubusercontent.com/u/62374784?v=4?s=100" width="100px;" alt="Abdul Samad"/><br /><sub><b>Abdul Samad</b></sub></a><br /><a href="https://github.com/cloudinary-community/next-cloudinary/commits?author=mr-loop-1" title="Documentation">📖</a></td>
206+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DevRish"><img src="https://avatars.githubusercontent.com/u/78094670?v=4?s=100" width="100px;" alt="Rishav Chattopadhyay"/><br /><sub><b>Rishav Chattopadhyay</b></sub></a><br /><a href="https://github.com/cloudinary-community/next-cloudinary/commits?author=DevRish" title="Documentation">📖</a></td>
207+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Prathamesh010"><img src="https://avatars.githubusercontent.com/u/41731424?v=4?s=100" width="100px;" alt="Prathamesh Gawas"/><br /><sub><b>Prathamesh Gawas</b></sub></a><br /><a href="https://github.com/cloudinary-community/next-cloudinary/commits?author=Prathamesh010" title="Documentation">📖</a></td>
206208
</tr>
207209
</tbody>
208210
</table>

docs/pages/cldimage/configuration.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ right inside of Next.js.
131131
example: () => (<code>45</code>),
132132
more: () => (<a className="whitespace-nowrap" href="https://cloudinary.com/documentation/transformation_reference#a_angle">More Info</a>)
133133
},
134+
{
135+
prop: 'aspectRatio',
136+
type: 'string',
137+
example: () => (<code>16:9</code>),
138+
more: () => (<a className="whitespace-nowrap" href="https://cloudinary.com/documentation/transformation_reference#ar_aspect_ratio">More Info</a>)
139+
},
134140
{
135141
prop: 'background',
136142
type: 'string',
@@ -251,6 +257,28 @@ angle={15}
251257

252258
[Learn more about angle](https://cloudinary.com/documentation/transformation_reference#b_background) on the Cloudinary docs.
253259

260+
### `aspectRatio`
261+
262+
Resizes the image to a new aspect ratio.
263+
264+
**Usage constraints**
265+
266+
The `aspectRatio` prop can be applied only in the following crop modes: `auto`, `crop`, `fill`, `lfill`, `fill_pad` and `thumb`.
267+
268+
Also, for it to work properly, `width` and `height` props must be absent, as they prevent the aspect ratio from applying as a transformation.
269+
However, `width` and `height` are required props for any Next Image component, unless we use the `fill` prop.
270+
271+
So, whenever the `aspectRatio` prop is used, the `fill` prop must always be present alongside it, the `crop` prop must be set to a supported
272+
crop mode, and the `width` and `height` props must be absent.
273+
274+
**Examples**
275+
276+
```jsx copy
277+
aspectRatio="16:9"
278+
```
279+
280+
[Learn more about aspectRatio](https://cloudinary.com/documentation/transformation_reference#ar_aspect_ratio) on the Cloudinary docs.
281+
254282
### `background`
255283

256284
Applies a background to empty or transparent areas.

docs/pages/guides/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"responsive-images": "Responsive Images",
88
"social-media-card": "Social Media Card",
99
"text-overlays": "Text Overlays",
10-
"uploading-images-and-videos": "Uploading Images & Videos"
10+
"uploading-images-and-videos": "Uploading Images & Videos",
11+
"using-custom-domains": "Using Custom Domains"
1112
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { useState } from 'react';
2+
import Head from 'next/head';
3+
import { CldImage } from 'next-cloudinary';
4+
import OgImage from '../../components/OgImage';
5+
import styles from '../../styles/Docs.module.scss';
6+
import { Callout } from 'nextra-theme-docs';
7+
8+
<Head>
9+
<title>Using Next Cloudinary with Custom Domains</title>
10+
<meta name="og:title" content="Using Next Cloudinary with Custom Domain" />
11+
<meta name="og:url" content={`https://next.cloudinary.dev/guides/using-custom-domains`} />
12+
</Head>
13+
14+
<OgImage
15+
title="Using Custom Domains - Next Cloudinary"
16+
twitterTitle="Using Next Cloudinary with Custom Domains"
17+
/>
18+
19+
# Using Custom Domains
20+
21+
When using Next Cloudinary with a custom domain in your Next.js application, you can serve your media assets with your own branded URLs.
22+
23+
<Callout type="info">
24+
This feature is relevant only for users on Advanced plans or higher. Advanced plan users can request a custom domain with Cloudinary. [Learn more](https://support.cloudinary.com/hc/en-us/articles/202520562-Can-we-deliver-our-assets-using-a-subdomain-of-our-own-domain-like-cdn-example-com)
25+
</Callout>
26+
27+
## Example
28+
29+
Display images and videos using your custom domain with the `CldImage` or `CldVideoPlayer` component.
30+
31+
```jsx
32+
<CldImage
33+
src={src}
34+
config={{
35+
privateCdn: true, // Set to true when using a custom domain
36+
secureDistribution: 'your-custom-domain.com', // Set your custom domain here
37+
}}
38+
/>
39+
```
40+
41+
## Learn More
42+
* [CldImage Config](/cldimage/configuration#config)
43+
* [CldVideoPlayer Config](/cldvideoplayer/configuration#configuration--delivery)

next-cloudinary/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-cloudinary",
3-
"version": "6.14.1",
3+
"version": "6.14.2",
44
"license": "MIT",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

next-cloudinary/src/components/CldVideoPlayer/CldVideoPlayer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const CldVideoPlayer = (props: CldVideoPlayerProps) => {
2626
onPlay,
2727
onEnded,
2828
width,
29-
} = props as CldVideoPlayerProps;
29+
} = props;
3030

3131
const uniqueId = useId();
3232

next-cloudinary/src/components/CldVideoPlayer/CldVideoPlayer.types.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import { MutableRefObject } from 'react';
22
import {
33
CloudinaryVideoPlayer,
44
CloudinaryVideoPlayerOptionsLogo,
5-
CloudinaryVideoPlayerOptions
65
} from '@cloudinary-util/types';
7-
import { ConfigOptions } from "@cloudinary-util/url-loader";
6+
import { ConfigOptions, GetVideoPlayerOptions } from "@cloudinary-util/url-loader";
87

98
import { GetCldImageUrlOptions } from '../../helpers/getCldImageUrl';
109
import { GetCldVideoUrlOptions } from '../../helpers/getCldVideoUrl';
1110

12-
export type CldVideoPlayerProps = Omit<CloudinaryVideoPlayerOptions, "cloud_name" | "autoplayMode" | "publicId" | "secure" | "showLogo" | "logoImageUrl" | "logoOnclickUrl"> & {
11+
export type CldVideoPlayerProps = Omit<GetVideoPlayerOptions, "cloud_name" | "autoplayMode" | "publicId" | "secure" | "showLogo" | "logoImageUrl" | "logoOnclickUrl"> & {
1312
className?: string;
1413
config?: ConfigOptions;
1514
id?: string;
@@ -31,4 +30,4 @@ export interface CldVideoPlayerPropsLogo {
3130
imageUrl?: CloudinaryVideoPlayerOptionsLogo['logoImageUrl'];
3231
logo?: boolean;
3332
onClickUrl?: CloudinaryVideoPlayerOptionsLogo['logoOnclickUrl'];
34-
}
33+
}

0 commit comments

Comments
 (0)