# @whiteguru/capacitor-plugin-media

> Capacitor plugin to handle media files

Latest version **8.0.1** (published 2025-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @whiteguru/capacitor-plugin-media
pnpm add @whiteguru/capacitor-plugin-media
yarn add @whiteguru/capacitor-plugin-media
bun add @whiteguru/capacitor-plugin-media
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.0.1 |
| Published | 2025-12-26 |
| First published | 2021-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 62.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Manuel Rodríguez |
| Maintainers | dragermrb |
| Keywords | capacitor, plugin, native |

## Links

- npm: https://www.npmjs.com/package/@whiteguru/capacitor-plugin-media
- Repository: https://github.com/dragermrb/capacitor-plugin-media
- Homepage: https://github.com/dragermrb/capacitor-plugin-media#readme
- Issues: https://github.com/dragermrb/capacitor-plugin-media/issues
- npm.io page: https://npm.io/package/@whiteguru/capacitor-plugin-media

## Recent versions

- 8.0.1 (latest) — 2025-12-26
- 5.0.1-0 (next) — 2023-05-04
- 7.1.0 — 2025-08-28
- 7.0.1 — 2025-08-24
- 6.0.1 — 2024-04-23
- 5.0.2 — 2023-09-12
- 5.0.1 — 2023-05-11
- 4.1.1 — 2023-01-25
- 4.1.0 — 2023-01-25
- 4.0.1 — 2022-09-06
- 3.0.1 — 2022-08-18
- 1.2.3 — 2022-03-25
- 1.2.2 — 2022-02-25
- 1.2.1 — 2022-02-10
- 1.2.0 — 2022-02-09
- … 4 more at https://npm.io/package/@whiteguru/capacitor-plugin-media/versions

## README

# @whiteguru/capacitor-plugin-media

Capacitor plugin to handle media files

## Install (Capacitor 8.x)

```bash
npm install @whiteguru/capacitor-plugin-media
npx cap sync
```

## Breaking Changes

Since version 7.0.2 the following methods have been removed:

- `getMedias()`
- `getAlbums()`
- `createAlbum()`

## Install (Capacitor 7.x)

```bash
npm install @whiteguru/capacitor-plugin-media@^7.0.2
npx cap sync
```

## Install (Capacitor 6.x)

```bash
npm install @whiteguru/capacitor-plugin-media@^6.0.2
npx cap sync
```

### or for Capacitor 5.x

```bash
npm install @whiteguru/capacitor-plugin-media@^5.0.2
npx cap sync
```

### or for Capacitor 4.x

```bash
npm install @whiteguru/capacitor-plugin-media@^4.1.1
npx cap sync
```

### or for Capacitor 3.x

```bash
npm install @whiteguru/capacitor-plugin-media@^3.0.1
npx cap sync
```

## Android

This API requires the following permissions be added to your `AndroidManifest.xml`:

```xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29"/>
```

Read about [Setting Permissions](https://capacitorjs.com/docs/android/configuration#setting-permissions) in the [Android Guide](https://capacitorjs.com/docs/android) for more information on setting Android permissions.

## API

<docgen-index>

* [`savePhoto(...)`](#savephoto)
* [`saveVideo(...)`](#savevideo)
* [`saveGif(...)`](#savegif)
* [`saveDocument(...)`](#savedocument)
* [`saveAudio(...)`](#saveaudio)
* [Interfaces](#interfaces)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### savePhoto(...)

```typescript
savePhoto(options?: MediaSaveOptions | undefined) => Promise<MediaResponse>
```

Add image to gallery. Creates album if not exists.

| Param         | Type                                                          |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#mediasaveoptions">MediaSaveOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#mediaresponse">MediaResponse</a>&gt;</code>

--------------------


### saveVideo(...)

```typescript
saveVideo(options?: MediaSaveOptions | undefined) => Promise<MediaResponse>
```

Add video to gallery. Creates album if not exists.

| Param         | Type                                                          |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#mediasaveoptions">MediaSaveOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#mediaresponse">MediaResponse</a>&gt;</code>

--------------------


### saveGif(...)

```typescript
saveGif(options?: MediaSaveOptions | undefined) => Promise<MediaResponse>
```

Add gif to gallery. Creates album if not exists.

| Param         | Type                                                          |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#mediasaveoptions">MediaSaveOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#mediaresponse">MediaResponse</a>&gt;</code>

--------------------


### saveDocument(...)

```typescript
saveDocument(options?: MediaSaveOptions | undefined) => Promise<MediaResponse>
```

Add document to gallery. Android only. Create album if not exists.

| Param         | Type                                                          |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#mediasaveoptions">MediaSaveOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#mediaresponse">MediaResponse</a>&gt;</code>

--------------------


### saveAudio(...)

```typescript
saveAudio(options?: MediaSaveOptions | undefined) => Promise<MediaResponse>
```

Add audio to gallery. Android only. Creates album if not exists.

| Param         | Type                                                          |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#mediasaveoptions">MediaSaveOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#mediaresponse">MediaResponse</a>&gt;</code>

--------------------


### Interfaces


#### MediaResponse

| Prop       | Type                | Description |
| ---------- | ------------------- | ----------- |
| **`path`** | <code>string</code> | Media path  |
| **`name`** | <code>string</code> | Media name  |


#### MediaSaveOptions

| Prop        | Type                                         | Description                                                                         |
| ----------- | -------------------------------------------- | ----------------------------------------------------------------------------------- |
| **`path`**  | <code>string</code>                          | Path of file to add                                                                 |
| **`album`** | <code>{ id?: string; name?: string; }</code> | Album to add media. If no 'id' and 'name' not exists, album 'name' will be created. |

</docgen-api>

---
_Source: https://npm.io/package/@whiteguru/capacitor-plugin-media · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
