diff --git a/README.md b/README.md index f059a6a..b3a4c1f 100644 --- a/README.md +++ b/README.md @@ -349,26 +349,26 @@ Allows the user to pick multiple pictures from the photo gallery. #### MediaResult -| Prop | Type | Description | Since | -| --------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | -| **`type`** | MediaType | The type of media result. Either `Photo` or `Video`. | 8.1.0 | -| **`uri`** | string | The URI pointing to the media file. Not available on Web. Use `webPath` instead for Web. | 8.1.0 | -| **`thumbnail`** | string | Returns the thumbnail of the media, base64 encoded. On Web, for `MediaType.Photo`, the full image is returned here, also base64 encoded. | 8.1.0 | -| **`saved`** | boolean | Whether if the media was saved to the gallery successfully or not. Only applicable if `saveToGallery` was set to `true` in input options. Otherwise, `false` is always returned for `save`. Not available on Web. | 8.1.0 | -| **`webPath`** | string | webPath returns a path that can be used to set the src attribute of a media item for efficient loading and rendering. | 8.1.0 | -| **`metadata`** | MediaMetadata | Metadata associated to the media result. Only included if `includeMetadata` was set to `true` in input options. | 8.1.0 | +| Prop | Type | Description | Since | +| --------------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | +| **`type`** | MediaType | The type of media result. Either `Photo` or `Video`. | 8.1.0 | +| **`uri`** | string | The URI pointing to the media file. Not available on Web. Use `webPath` instead for Web. | 8.1.0 | +| **`thumbnail`** | string | Returns the thumbnail of the media, base64 encoded. On Web, for `MediaType.Photo`, the full image is returned here, also base64 encoded. On Web, for `MediaType.Video`, a full-resolution JPEG frame captured from the video is returned, base64 encoded at 80% quality. | 8.1.0 | +| **`saved`** | boolean | Whether if the media was saved to the gallery successfully or not. Only applicable if `saveToGallery` was set to `true` in input options. Otherwise, `false` is always returned for `save`. Not available on Web. | 8.1.0 | +| **`webPath`** | string | webPath returns a path that can be used to set the src attribute of a media item for efficient loading and rendering. | 8.1.0 | +| **`metadata`** | MediaMetadata | Metadata associated to the media result. Only included if `includeMetadata` was set to `true` in input options. | 8.1.0 | #### MediaMetadata -| Prop | Type | Description | Since | -| ------------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | -| **`size`** | number | File size of the media, in bytes Not available on Web. | 8.1.0 | -| **`duration`** | number | Only applicable for `MediaType.Video` - the duration of the media, in seconds. Not available on Web. | 8.1.0 | -| **`format`** | string | The format of the image, ex: jpeg, png, mp4. Web supports jpeg, png and gif, but the exact availability may vary depending on the browser. gif is only supported for `chooseFromGallery`, and only if `webUseInput` option is set to `true`. | 8.1.0 | -| **`resolution`** | string | The resolution of the media, in `<width>x<height>` format. Example: '1920x1080'. | 8.1.0 | -| **`creationDate`** | string | The date and time the media was created, in ISO 8601 format. If creation date is not available (e.g. Android 7 and below), the last modified date is returned. Not available on web. | 8.1.0 | -| **`exif`** | string | Exif data, if any, retreived from the media item. Not available on Web. | 8.1.0 | +| Prop | Type | Description | Since | +| ------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- | +| **`size`** | number | File size of the media, in bytes. | 8.1.0 | +| **`duration`** | number | Only applicable for `MediaType.Video` - the duration of the media, in seconds. | 8.1.0 | +| **`format`** | string | The format of the image, ex: jpeg, png, mp4. Web supports jpeg, png and gif, but the exact availability may vary depending on the browser. gif is only supported for `chooseFromGallery` on Web. | 8.1.0 | +| **`resolution`** | string | The resolution of the media, in `<width>x<height>` format. Example: '1920x1080'. | 8.1.0 | +| **`creationDate`** | string | The date and time the media was created, in ISO 8601 format. If creation date is not available (e.g. Android 7 and below), the last modified date is returned. For Web, the last modified date is always returned. | 8.1.0 | +| **`exif`** | string | Exif data, if any, retreived from the media item. Not available on Web. | 8.1.0 | #### TakePhotoOptions @@ -386,7 +386,7 @@ Allows the user to pick multiple pictures from the photo gallery. | **`editInApp`** | boolean | If `true`, will use an in-app editor for photo edition. If `false`, will open a separate (platform-specific) native app to handle photo edition, falling back to the in-app editor if none is available. Only applicable with `allowEdit` set to true. Note: This option is only supported on Android and iOS. | true | 8.1.0 | | **`presentationStyle`** | 'fullscreen' \| 'popover' | iOS only: The presentation style of the Camera. | 'fullscreen' | 8.1.0 | | **`webUseInput`** | boolean | Web only: Whether to use the PWA Element experience or file input. The default is to use PWA Elements if installed and fall back to file input. To always use file input, set this to `true`. Learn more about PWA Elements: https://capacitorjs.com/docs/web/pwa-elements | | 8.1.0 | -| **`includeMetadata`** | boolean | Whether or not MediaResult should include its metadata. If an error occurs when obtaining the metadata, it will return empty. Note: This option is only supported on Android and iOS. | false | 8.1.0 | +| **`includeMetadata`** | boolean | Whether or not MediaResult should include its metadata. If an error occurs when obtaining the metadata, it will return empty. | false | 8.1.0 | #### RecordVideoOptions @@ -419,7 +419,7 @@ Allows the user to pick multiple pictures from the photo gallery. | **`mediaType`** | MediaTypeSelection | The type of media to select. Can be pictures, videos, or both. | MediaTypeSelection.Photo | 8.1.0 | | **`allowMultipleSelection`** | boolean | Whether or not to allow selecting multiple media files from the gallery. | false | 8.1.0 | | **`limit`** | number | The maximum number of media files that the user can choose. Only applicable if `allowMultipleSelection` is `true`. Any non-positive number will be treated as unlimited. Note: This option is only supported on Android 13+ and iOS. | 0 | 8.1.0 | -| **`includeMetadata`** | boolean | Whether or not MediaResult should include its metadata. If an error occurs when obtaining the metadata, it will return empty. Note: This option is only supported on Android and iOS. | false | 8.1.0 | +| **`includeMetadata`** | boolean | Whether or not MediaResult should include its metadata. If an error occurs when obtaining the metadata, it will return empty. | false | 8.1.0 | | **`allowEdit`** | boolean | Whether to allow the user to crop or make small edits. Only applicable for `MediaTypeSelection.Photo` and `allowMultipleSelection` set to `false`. Note: This option is only supported on Android and iOS. | false | 8.1.0 | | **`editInApp`** | boolean | If `true`, will use an in-app editor for photo edition. If `false`, will open a separate (platform-specific) native app to handle photo edition, falling back to the in-app editor if none is available. Only applicable with `allowEdit` set to true. Note: This option is only supported on Android and iOS. | true | 8.1.0 | | **`presentationStyle`** | 'fullscreen' \| 'popover' | iOS only: The presentation style of media picker. | 'fullscreen' | 8.1.0 | @@ -446,11 +446,11 @@ Allows the user to pick multiple pictures from the photo gallery. #### EditURIPhotoOptions -| Prop | Type | Description | Default | Since | -| --------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | -| **`uri`** | string | The URI that contains the photo to edit. | | 8.1.0 | -| **`saveToGallery`** | boolean | Whether to save the edited photo to the gallery. | false | 8.1.0 | -| **`includeMetadata`** | boolean | Whether or not MediaResult should include its metadata. If an error occurs when obtaining the metadata, it will return empty. Note: This option is only supported on Android and iOS. | false | 8.1.0 | +| Prop | Type | Description | Default | Since | +| --------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | +| **`uri`** | string | The URI that contains the photo to edit. | | 8.1.0 | +| **`saveToGallery`** | boolean | Whether to save the edited photo to the gallery. | false | 8.1.0 | +| **`includeMetadata`** | boolean | Whether or not MediaResult should include its metadata. If an error occurs when obtaining the metadata, it will return empty. | false | 8.1.0 | #### GalleryPhotos diff --git a/android/src/main/java/com/capacitorjs/plugins/camera/IonCameraFlow.kt b/android/src/main/java/com/capacitorjs/plugins/camera/IonCameraFlow.kt index 8bcc33e..c46305f 100644 --- a/android/src/main/java/com/capacitorjs/plugins/camera/IonCameraFlow.kt +++ b/android/src/main/java/com/capacitorjs/plugins/camera/IonCameraFlow.kt @@ -832,9 +832,6 @@ class IonCameraFlow( activity, intent, ionParams, - { image -> - //TODO remove this callback - }, { mediaResult -> handleMediaResult(mediaResult) }, @@ -938,7 +935,6 @@ class IonCameraFlow( correctOrientation = correctOrientation, saveToPhotoAlbum = saveToGallery, includeMetadata = includeMetadata, - latestVersion = true //TODO check this, because now we don't have resultType in the new Api ) } diff --git a/example-app/src/components/camera/ChooseFromGalleryConfigurable.tsx b/example-app/src/components/camera/ChooseFromGalleryConfigurable.tsx index 7de3360..1b07a2e 100644 --- a/example-app/src/components/camera/ChooseFromGalleryConfigurable.tsx +++ b/example-app/src/components/camera/ChooseFromGalleryConfigurable.tsx @@ -85,7 +85,6 @@ class ChooseFromGalleryConfigurable extends React.Component< targetWidth: config.targetWidth, targetHeight: config.targetHeight, correctOrientation: config.correctOrientation, - webUseInput: config.webUseInput, }); console.log('chooseFromGallery result', result); @@ -249,16 +248,6 @@ class ChooseFromGalleryConfigurable extends React.Component< /> - - Web Use Input - - this.updateConfig("webUseInput", e.detail.checked) - } - /> - - = ({ media, onEditPhoto }) => return ( {isVideo(item) ? ( - + ) : ( = ({ filePath, metadata, + thumbnail, }) => { const formatMetadata = (meta: MediaMetadata | string | null | undefined): string => { if (!meta) return ''; @@ -51,6 +53,7 @@ const VideoWithMetadata: React.FC = ({