🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@wisdomgarden/media-picker

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wisdomgarden/media-picker

This is a Capacitor 2 plugin that provides a Media Picker for selecting images and videos.

latest
npmnpm
Version
1.0.1
Version published
Maintainers
0
Created
Source

Media Picker Plugin

This is a Capacitor 2 plugin that provides a Media Picker for selecting images and videos.

  • Media Picker Plugin
  • Install
  • Example
  • API

Install

npm install @wisdomgarden/media-picker
npx cap sync

or

yarn install @wisdomgarden/media-picker 
npx cap sync

Example

// use in web
import { MediaPicker } from '@wisdomgarden/media-picker';
// use in native
import { Plugins } from '@capacitor/core';

const { MediaPicker } = Plugins;
var ret = await MediaPicker.checkAvailability();

console.log('is available', ret.isAvailable);

ret = await MediaPicker.pickMedias({
  type: MediaPicker.MEDIA_TYPE.ImageOAndVideo,
  maximum: 2
})

if(ret && ret.uris) {
  console.log('picked medias', ret.uris);
}

API

checkAvailability

checkAvailability(): Promise<AvailabilityState>;

Get the availability state of the media picker.

Returns: Promise<AvailabilityState>

PropertyTypeDescription
isAvailablebooleanWhether the media picker is available

pickMedias

pickMedias(options: {type: PICK_MEDIA_TYPE, maximum?: number}): Promise<PickMediasResult>;

Pick multiple medias.

ParamsTypeDescriptionrequireddefault
typePICK_MEDIA_TYPEThe type of media to picktrue
maximumnumberThe maximum number of media to pickfalse1

Returns: Promise<PickMediasResult>

Interfaces

AvailabilityState

PropTypeDescription
isAvailablebooleanWhether the media picker is available

PICK_MEDIA_TYPE

PropTypeDescription
ImageOnlystringOnly images
VideoOnlystringOnly videos
ImageOAndVideostringImages and videos

PickMediasResult

PropTypeDescription
urisstring[]The uris of the picked media or undefined if no media is picked

Keywords

capacitor

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts