Ionic Framework 4 is almost here. Preview the beta docs and try it out now! Try Ionic 4 Beta

LastCam

Improve this doc

Last Cam is a Camera Preview plugin that allows you to take capture both Videos and images in a custom html preview of your choice.

Repo: https://github.com/bengejd/cordova-plugin-last-cam

Installation

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

Supported platforms

Instance Members

startCamera(options)

Starts the camera preview instance.

Param Type Details
options LastCamStartupOptions

Returns: Promise<any>

stopCamera()

Stops the camera preview instance. (iOS)

Returns: Promise<any>

switchCamera()

Switch from the rear camera and front camera, if available.

Returns: Promise<any>

switchFlash()

Switch the flash mode.

Returns: Promise<any>

takePicture()

Take the picture (base64)

Returns: Promise<any>

startVideoCapture()

Start the video capture

Returns: Promise<any>

stopVideoCapture()

Stops the video capture

Returns: Promise<any>

recordingTimer()

Promise of the recordingTimer.

Returns: Promise<any>

watchRecordingTimer()

Observable of the recordingTimer.

Returns: Observable<any>

LastCamStartupOptions

Param Type Details
x number

The left edge in pixels, default 0

(optional)
y number

The top edge in pixels, default 0

(optional)
width number

The width in pixels, default window.screen.width

(optional)
height number

The height in pixels, default window.screen.height

(optional)
camera string

Choose the camera to use 'front' or 'back', default 'front'

(optional)

API

Native

General