Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Video Capture Plusβ

Improve this doc

This plugin is still in beta stage and may not work as expected. Please submit any issues to the plugin repo.

This plugin offers some useful extras on top of the default Media Capture Plugin capabilities:

Repo: https://github.com/danielsogl/cordova-plugin-video-capture-plus

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-video-capture-plus
    $ npm install --save @ionic-native/video-capture-plus@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { VideoCapturePlus, VideoCapturePlusOptions, MediaFile } from '@ionic-native/video-capture-plus';


constructor(private videoCapturePlus: VideoCapturePlus) { }

...

const options: VideoCapturePlusOptions = {
   limit: 1,
   highquality: true,
   portraitOverlay: 'assets/img/camera/overlay/portrait.png',
   landscapeOverlay: 'assets/img/camera/overlay/landscape.png'
}

this.videoCapturePlus.captureVideo(options).then(mediafile: MediaFile[] => console.log(mediafile), error => console.log('Something went wrong'));

Instance Members

captureVideo(options)

Starts recordings

Param Type Details
options VideoCapturePlusOptions

Configure optionsOptional

Returns: Promise<MediaFile[]>

MediaFile

Param Type Details
name string

The name of the file, without path information.

fullPath string

The full path of the file, including the name.

type string

The file's mime type

lastModifiedDate Date

The date and time when the file was last modified.

size number

The size of the file, in bytes.

getFormatData any

Retrieves the format information of the media file.

MediaFileData

Param Type Details
codecs string

The actual format of the audio and video content.

bitrate number

The average bitrate of the content. The value is zero for images.

height number

The height of the image or video in pixels. The value is zero for audio clips.

width number

The width of the image or video in pixels. The value is zero for audio clips.

duration number

The length of the video or sound clip in seconds. The value is zero for images.

VideoCapturePlusOptions

Param Type Details
limit number

The number of videos to record, default 1 (on iOS always 1)

(optional)
duration number

Max duration in seconds, default 0, which is 'forever'

(optional)
highquality boolean

Set to true to override the default low quality setting

(optional)
frontcamera boolean

Set to true to override the default backfacing camera setting. You'll want to sniff the useragent/device and pass the best overlay based on that.. assuming iphone here

(optional)
portraitOverlay string

put the png overlay in your assets folder

(optional)
landscapeOverlay string

not passing an overlay means no image is shown for the landscape orientation

(optional)
overlayText string

iOS only

(optional)

API

Native

General