Skip to content

Chore/2.7.0 #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/1.getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CLOUDINARY_CLOUD_NAME=<YOUR_CLOUDINARY_CLOUD_NAME>
```

::callout{icon="i-heroicons-check-circle"}
And that's it! You can now use Clodinary in Nuxt ✨
And that's it! You can now use Cloudinary in Nuxt ✨
::

```vue
Expand Down
7 changes: 5 additions & 2 deletions docs/content/2.components/CldImage/2.configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description:
description:
---

The CldImage component provides a wide range of options for being able to easily optimize and transform images.
Expand Down Expand Up @@ -27,10 +27,13 @@ The CldImage component exposes many of Cloudinary's transformations in an easy-t

| Prop | Type | Default | Example | More |
| --------------------- | ----------------------- | --------- | ----------------------- | ------------------------------------------------------------------------------------------ |
| angle | number | `-` | `45` | [Link](https://cloudinary.com/documentation/transformation_reference#a_angle) |
| crop | string | `"limit"` | `"thumb"` | [Link](https://cloudinary.com/documentation/transformation_reference#c_crop_resize) |
| background | string | `-` | `"blue"` | [Link](https://cloudinary.com/documentation/transformation_reference#b_background) |
| fillBackground (Beta) | `boolean/object` | `-` | `{{ gravity: 'east' }}` | [Link](https://cloudinary.com/documentation/transformation_reference#b_gen_fill) |
| enhance | boolean | `-` | `{{ gravity: 'east' }}` | [Link](https://cloudinary.com/documentation/transformation_reference#b_gen_fill) |
| fillBackground (Beta) | `boolean/object` | `-` | `true` | [Link](https://cloudinary.com/documentation/transformation_reference#e_enhance) |
| gravity | string | `auto` | `"faces"` | [Link](https://cloudinary.com/documentation/transformation_reference#g_gravity) |
| loop | `boolean/number` | `-` | `true` | [Link](https://cloudinary.com/documentation/transformation_reference#e_loop) |
| recolor | `array/object` | `-` | `['duck', 'blue']` | [Link](https://cloudinary.com/documentation/transformation_reference#e_gen_recolor) |
| remove | `string/array/object` | `-` | `apple` | [Link](https://cloudinary.com/documentation/transformation_reference#e_gen_remove) |
| removeBackground | `boolean/string` | `false` | `true` | [Link](https://cloudinary.com/documentation/transformation_reference#e_background_removal) |
Expand Down
70 changes: 43 additions & 27 deletions docs/content/2.components/CldVideoPlayer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description:
description:
---

## The usage
Expand Down Expand Up @@ -62,33 +62,49 @@ Check the browser console after playing and pausing the video for logs that were

:video-player-with-events

## Picture in Picture

Picture-in-picture helps your viewers continue their multitasking agenda and maintain context while navigating different apps or interfaces using picture-in-picture functionality.

```html
<CldVideoPlayer
width="600"
height="600"
src="<Cloudinary URL>"
pictureInPictureToogle
/>
```

:cld-video-player{src="videos/mountain-stars" width="900" height="900" style="aspect-ratio: 1620 / 1080" pictureInPictureToggle}

## General Props

| Prop Name | Type | Default | Description | Example |
| -------------- | -------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| autoPlay | string | `"never"` | When, if, should the video automatically play. See `autoplayMode` in [Video Player docs](https://cloudinary.com/documentation/video_player_api_reference#constructor_parameters) | `"on-scroll"` |
| className | string | - | Additional class names added to the video container | `"my-video-player"` |
| colors | object | See below | Player chrome colors | See Colors Below |
| controls | boolean | `true` | Show player controls | `true` |
| fontFace | string | - | Player UI font. Uses Google Fonts. | `"Source Serif Pro"` |
| height | string/number | - | **Required**: Player height | `1080` |
| id | string | - | Video instance ID, defaults to src value | `"my-video"` |
| logo | boolean/object | See Below | Logo to display in Player UI | See Logo Below |
| loop | boolean | `false` | Loop the video | `true` |
| muted | boolean | `false` | Load muted by default | `true` |
| onDataLoad | Function | - | Triggered when video metadata is loaded | See Events Below |
| onError | Function | - | Triggered on video error | See Events Below |
| onMetadataLoad | Function | - | Triggered when video data is loaded | See Events Below |
| onPause | Function | - | Triggered on video pause | See Events Below |
| onPlay | Function | - | Triggered on video play | See Events Below |
| onEnded | Function | - | Triggered when video has ended play | See Events Below |
| playerRef | Ref | - | React ref to access Player instance | See Refs Below |
| showLogo | boolea | `true` | Show the Cloudinary logo on Player | `false` |
| src | string | - | **Required**: Video public ID | `"videos/my-video"` |
| transformation | object/array | - | Transformations to apply to the video | `{ width: 200, height: 200, crop: 'fill' }` |
| version | string | `"1.9.4"` | Cloudinary Video Player version | `"1.9.4"` |
| videoRef | Ref | - | React ref to access video element | See Refs Below |
| width | string/number | - | **Required**: Player width | `1920` |
| Prop Name | Type | Default | Description | Example |
| ---------------------- | -------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| autoPlay | string | `"never"` | When, if, should the video automatically play. See `autoplayMode` in [Video Player docs](https://cloudinary.com/documentation/video_player_api_reference#constructor_parameters) | `"on-scroll"` |
| className | string | - | Additional class names added to the video container | `"my-video-player"` |
| colors | object | See below | Player chrome colors | See Colors Below |
| controls | boolean | `true` | Show player controls | `true` |
| fontFace | string | - | Player UI font. Uses Google Fonts. | `"Source Serif Pro"` |
| height | string/number | - | **Required**: Player height | `1080` |
| id | string | - | Video instance ID, defaults to src value | `"my-video"` |
| logo | boolean/object | See Below | Logo to display in Player UI | See Logo Below |
| loop | boolean | `false` | Loop the video | `true` |
| muted | boolean | `false` | Load muted by default | `true` |
| onDataLoad | Function | - | Triggered when video metadata is loaded | See Events Below |
| onError | Function | - | Triggered on video error | See Events Below |
| onMetadataLoad | Function | - | Triggered when video data is loaded | See Events Below |
| onPause | Function | - | Triggered on video pause | See Events Below |
| onPlay | Function | - | Triggered on video play | See Events Below |
| onEnded | Function | - | Triggered when video has ended play | See Events Below |
| playerRef | Ref | - | React ref to access Player instance | See Refs Below |
| showLogo | boolean | `true` | Show the Cloudinary logo on Player | `false` |
| src | string | - | **Required**: Video public ID | `"videos/my-video"` |
| transformation | object/array | - | Transformations to apply to the video | `{ width: 200, height: 200, crop: 'fill' }` |
| version | string | `"1.10.6"` | Cloudinary Video Player version | `"1.9.4"` |
| videoRef | Ref | - | React ref to access video element | See Refs Below |
| width | string/number | - | **Required**: Player width | `1920` |
| pictureInPictureToogle | boolean | - | Enable Picture in Picture mode | true |

## Colors Prop

Expand Down Expand Up @@ -139,7 +155,7 @@ To do this, create a new Ref instance and pass as ref to the `CldVideoPlayer` co
<script setup lang="ts">
const cldVideoPlayerRef = ref();

console.log(cldVideoPlayerRef)
console.log(cldVideoPlayerRef);
// will output { playerRef, videoRef }
</script>

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"stackblitz": "cd .stackblitz && yarn && yarn dev"
},
"dependencies": {
"@cloudinary-util/url-loader": "^4.2.0",
"@cloudinary-util/url-loader": "^5.2.1",
"@cloudinary-util/types": "1.0.1",
"@nuxt/kit": "^3.5.0",
"@unpic/vue": "^0.0.42",
"defu": "^6.1.2"
Expand Down
22 changes: 5 additions & 17 deletions playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const cldVideoRef = ref();
</script>

<template>
<button :id="buttonId">
Select Image or Video
</button>
<button :id="buttonId">Select Image or Video</button>
<CldMediaLibrary
api-key="12345"
:button-id="buttonId"
Expand All @@ -29,28 +27,18 @@ const cldVideoRef = ref();
:button-id="buttonId"
/>
<!-- Usage of `CldOgImage.vue` component -->
<CldOgImage
src="cld-sample-2"
twitter-title="test"
/>
<CldOgImage src="cld-sample-2" twitter-title="test" />
<!-- Usage of `CldVideoPlayer.vue` component -->
<CldVideoPlayer
ref="cldVideoRef"
width="1620"
height="1080"
src="videos/mountain-stars"
pictureInPictureToggle
/>
<!-- Usage of `CldUploadWidget.vue` component -->
<CldUploadWidget
v-slot="{ open }"
upload-preset="nuxt-cloudinary-unsigned"
>
<button
type="button"
@click="open"
>
Upload an Image
</button>
<CldUploadWidget v-slot="{ open }" upload-preset="nuxt-cloudinary-unsigned">
<button type="button" @click="open">Upload an Image</button>
</CldUploadWidget>
<!-- Usage of `CldUploadButton.vue` component -->
<CldUploadButton upload-preset="nuxt-cloudinary-unsigned">
Expand Down
Loading