Socket
Socket
Sign inDemoInstall

gallery-video-picker

Package Overview
Dependencies
2
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gallery-video-picker

This plugin is used to get video from gallery


Version published
Weekly downloads
15
Maintainers
1
Created
Weekly downloads
 

Readme

Source

It is capacitor plugin that will help you to pick video path (duration, type, name, size) from gallery. You can also record video.

Android only support!

Installation

Use the package manager npm to install plugin.

npm install gallery-video-picker

Usage

import 'gallery-video-picker';
import { Plugins } from '@capacitor/plugin';

const { Camera } = Plugins;

const takeVideo = async () => {
  const options = {
      sizeLimit: 10, // Maximum size of file in megabytes (Only PickerVideoType.GALLERY)
      source: PickerVideoType.CAMERA, // PickerVideoType.CAMERA, PickerVideoType.GALLERY
      duration: 30,  // Maximum duration (Only PickerVideoType.CAMERA)
      quality: number, // Quality from 0 to 1. 0 - Bad quality, 1 - Good, 0.5 - So so
  };

  const videoMetadata = Plugins.GalleryVideoPicker.getVideoFromGallery(options).then((result) => {
    // result 
    { 
        type: "video/mp4",
        name: "example.mp4", 
        path: "file:///storage/**", 
        duration: 30, // seconds
        size: 1277125 // bytes
    }
  });
};
const requestPermission = async () => {
  const options = {
      // Request access to record video - PickerVideoType.CAMERA, Request access to video gallery - PickerVideoType.GALLERY
      permissionType: PickerVideoType.CAMERA, 
  };

  const videoMetadata = Plugins.GalleryVideoPicker.getPermissions(options).then(
      (res) => // { granted: true, permission: PickerVideoType.CAMERA },
      (err) => // { message: "Permission denied" }
  );
};
const openSettings = async () => {
  const videoMetadata = await Plugins.GalleryVideoPicker.openSettings(); // Just open app settings
};

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Keywords

FAQs

Last updated on 17 Apr 2021

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc