Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bechstein/capacitor-media
https://github.com/bechstein/capacitor-media
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bechstein/capacitor-media
- Owner: bechstein
- Created: 2024-01-17T11:29:25.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-22T09:05:34.000Z (12 months ago)
- Last Synced: 2024-06-07T09:16:46.321Z (7 months ago)
- Language: Swift
- Size: 2.98 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
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
|