Skip to content

Open audio, video, images and more with applications installed on the user's device

License

Notifications You must be signed in to change notification settings

hit0907/cordova-open

 
 

Repository files navigation

cordova-open

Build Status Code Climate

Open audio, video, images and more with applications installed on the user's device.

Install

$ cordova plugin add cordova-open

Usage

var open = cordova.plugins.disusered.open;

function success() {
  console.log('Success');
}

function error(code) {
  if (code === 1) {
    console.log('No file handler found');
  } else {
    console.log('Undefined error');
  }
}

open('file:/storage/sdcard/DCIM/Camera/1404177327783.jpg', success, error);

API

The plugin exposes the following methods:

cordova.plugins.disusered.open(file, success, error, trustAllCertificates)

Parameters:

  • file: A string representing a URI
  • success: Optional success callback
  • error: Optional error callback
  • trustAllCertificates: Optional, trusts any certificate when the connection is done over HTTPS.

Events:

  • pause: Opening files emits Cordova's pause event (Android only)
  • resume: Closing the file emits Cordova's resume event
  • open.success: File is found and can be opened
  • open.error: File not found, or no file handler is installed

License

MIT © Carlos Rosquillas

About

Open audio, video, images and more with applications installed on the user's device

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 43.1%
  • Objective-C 27.1%
  • Java 25.2%
  • Shell 4.6%