npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

capacitor-viber-gallery-picker

v1.2.3

Published

Viber-like media picker with live camera preview and gallery selection

Readme

Capacitor Viber Gallery Picker

A Capacitor plugin that provides Viber-like media picker functionality with gallery access and camera capture.

Features

  • Get gallery media with pagination (images and videos)
  • Capture photos and videos
  • Get media thumbnails
  • Get full media data (base64)
  • Works on Android, iOS, and Web

Installation

In your Capacitor project

npm install /path/to/capacitor-viber-gallery-picker
npx cap sync

In your Next.js project

npm install /path/to/capacitor-viber-gallery-picker

Usage

import { ViberGalleryPicker } from '@capacitor-viber-gallery-picker';

// Get gallery media with pagination
const result = await ViberGalleryPicker.getGalleryMedia({
  limit: 20,
  offset: 0,
  mediaType: 'all'
});

// Capture photo
const photo = await ViberGalleryPicker.capturePhoto({ quality: 100 });

// Capture video
const video = await ViberGalleryPicker.captureVideo({ 
  quality: 100,
  maxDuration: 60 
});

// Get thumbnail
const thumbnail = await ViberGalleryPicker.getMediaThumbnail({
  identifier: 'media-id',
  size: 200
});

// Get full media data
const mediaData = await ViberGalleryPicker.getMediaData({
  identifier: 'media-id'
});

API

getGalleryMedia(options?)

Get media from gallery with pagination.

Options:

  • limit?: number - Number of items to fetch (default: 50)
  • offset?: number - Offset for pagination (default: 0)
  • mediaType?: 'all' | 'images' | 'videos' - Filter by type (default: 'all')

Returns:

  • media: MediaItem[] - Array of media items
  • hasMore: boolean - Whether there are more items
  • totalCount: number - Total count of media

capturePhoto(options?)

Capture a photo using the camera.

Options:

  • quality?: number - Image quality 0-100 (default: 100)

Returns:

  • path: string - File path
  • base64?: string - Base64 encoded image
  • type: 'image' - Media type

captureVideo(options?)

Capture a video using the camera.

Options:

  • quality?: number - Video quality (default: 100)
  • maxDuration?: number - Max duration in seconds (default: 60)

Returns:

  • path: string - File path
  • base64?: string - Base64 encoded video
  • type: 'video' - Media type

getMediaThumbnail(options)

Get thumbnail for a media item.

Options:

  • identifier: string - Media identifier
  • size?: number - Thumbnail size (default: 200)

Returns:

  • thumbnail: string - Base64 thumbnail data URL

getMediaData(options)

Get full media data.

Options:

  • identifier: string - Media identifier

Returns:

  • path: string - File path
  • base64: string - Base64 encoded media
  • type: 'image' | 'video' - Media type

Permissions

Android

Add to AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />

The plugin uses the Android Photo Picker on API 33+ and the Storage Access Framework below that level, so do not declare READ_MEDIA_* or READ_EXTERNAL_STORAGE permissions in your app. Google Play will reject builds that keep those entries without a core media-management use case.

iOS

Add to Info.plist:

<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photo library</string>
<key>NSCameraUsageDescription</key>
<string>We need access to your camera</string>