1.0.15 • Published 7 years ago

cordova-background-video v1.0.15

Weekly downloads
3
License
GPL3
Repository
github
Last release
7 years ago

cordova-background-video

A simple Cordova/Phonegap plugin to capture video and then display it onscreen via a transparent overlay without affecting app functionality.

How to use

Install

cordova plugin add https://github.com/jamesla/backgroundvideo.git

Usage

cordova.plugins.backgroundvideo.start(fileStorage, filename, camera, quality, successfn, errorfn);

Getting started

start recording
cordova.plugins.backgroundvideo.start('cacheDirectory', 'myvideo', 'front', 'medium', null, null);
stop recording
cordova.plugins.backgroundvideo.stop(successFn, errorFn);

Other bits

Quality can be medium, low, high

Camera 'front' or 'back' to specify camera direction.

File

  • Outputs as mp4. You do not need to specify file extension.
  • Video files are saved to approot/tmp folder (cordova.plugins.backgroundvideo.stop() will return the file path).

File System Layouts

Although technically an implementation detail, it can be very useful to know how the cordova.file.* properties map to physical paths on a real device.

iOS File System Layout

Device Pathcordova.file.*iosExtraFileSystemsr/w?persistent?OS clearssyncprivate
/var/mobile/Applications/<UUID>/applicationStorageDirectory-rN/AN/AN/AYes
   appname.app/applicationDirectorybundlerN/AN/AN/AYes
      www/--rN/AN/AN/AYes
   Documents/documentsDirectorydocumentsr/wYesNoYesYes
      NoCloud/-documents-nosyncr/wYesNoNoYes
   Library-libraryr/wYesNoYes?Yes
      NoCloud/dataDirectorylibrary-nosyncr/wYesNoNoYes
      Cloud/syncedDataDirectory-r/wYesNoYesYes
      Caches/cacheDirectorycacher/wYes*Yes***NoYes
   tmp/tempDirectory-r/wNo**Yes***NoYes

Android File System Layout

Device Pathcordova.file.*AndroidExtraFileSystemsr/w?persistent?OS clearsprivate
file:///android_asset/applicationDirectoryassetsrN/AN/AYes
/data/data/<app-id>/applicationStorageDirectory-r/wN/AN/AYes
   cachecacheDirectorycacher/wYesYes*Yes
   filesdataDirectoryfilesr/wYesNoYes
      Documentsdocumentsr/wYesNoYes
<sdcard>/externalRootDirectorysdcardr/wYesNoNo
   Android/data/<app-id>/externalApplicationStorageDirectory-r/wYesNoNo
      cacheexternalCacheDirectrycache-externalr/wYesNo**No
      filesexternalDataDirectoryfiles-externalr/wYesNoNo

Support

Please use the github issue tracker and we will come back to you as soon as we can.

Contribution

There's lots of Android phones all with their own quirks so we'd love it if you could contribute and help us support all of the devices out there.