Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bechstein/capacitor-media


https://github.com/bechstein/capacitor-media

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

        

# @cbechstein-digital/capacitor-media

A capacitor plugin for interacting with the media library

## Install

```bash
npm install @cbechstein-digital/capacitor-media
npx cap sync
```

## Setup

#### Angular:
To get a dummy response on the web, add the following to your `angular.json` under `projects..architect.build.options.assets`:
```angular2html
{
"glob": "**/*.png",
"input": "node_modules/@cbechstein-digital/capacitor-media/src/assets/web/",
"output": "./assets/plugins/capacitor-media/web"
}
```

## Permissions
The required permissions for the plugin are as follows:

On `Android`, add the following two permissions to your `androidManifest.xml` inside the `manifest` tag:
```

```

On `iOS`, add the following key to your `Info.plist` file with a description about why does your app needs this permission:
```

.
.
.
NSPhotoLibraryUsageDescription
To show the thumbnail of the latest recorded video in the app
.
.
.

```
Replace the description between `string` based on your need.

## API

* [`getLatestVideoThumbnailFromAlbum(...)`](#getlatestvideothumbnailfromalbum)
* [`openPhotosApp()`](#openphotosapp)
* [Interfaces](#interfaces)

### getLatestVideoThumbnailFromAlbum(...)

```typescript
getLatestVideoThumbnailFromAlbum(options: GetLatestVideoThumbnailFromAlbumOptions) => Promise
```

Returns a thumbnail from the newest video in a specific album

| Param | Type | Description |
| ------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **`options`** | GetLatestVideoThumbnailFromAlbumOptions | – The album name and the size of the resulting thumbnail. The album name is not supported and will be ignored on Android. |

**Returns:** Promise<GetLatestVideoThumbnailFromAlbumResults>

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

### openPhotosApp()

```typescript
openPhotosApp() => Promise
```

Opens the photos app of the phone

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

### Interfaces

#### GetLatestVideoThumbnailFromAlbumResults

| Prop | Type |
| ----------- | ------------------- |
| **`value`** | string |

#### GetLatestVideoThumbnailFromAlbumOptions

| Prop | Type |
| --------------- | ------------------------------------------------------- |
| **`albumName`** | string |
| **`size`** | ThumbnailSize |

#### ThumbnailSize

| Prop | Type |
| ------------ | ------------------- |
| **`width`** | number |
| **`height`** | number |