Skip to content

Commit

Permalink
feat(camera-preview): add new focus methods & getFlashMode() (#1442)
Browse files Browse the repository at this point in the history
4 new methods are available in the master:
- getSupportedFocusModes();
- getFocusMode();
- seFocusMode();
- getFlashMode();
  • Loading branch information
SVANNER authored and ihadeed committed Apr 30, 2017
1 parent 1a682bc commit 748c6bd
Showing 1 changed file with 48 additions and 5 deletions.
53 changes: 48 additions & 5 deletions src/@ionic-native/plugins/camera-preview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,18 @@ export interface CameraPreviewPictureOptions {
@Injectable()
export class CameraPreview extends IonicNativePlugin {

EXPOSURE_MODES = {
FOCUS_MODE = {
FIXED: 'fixed',
AUTO: 'auto',
CONTINUOUS: 'continuous', // IOS Only
CONTINUOUS_PICTURE: 'continuous-picture', // Android Only
CONTINUOUS_VIDEO: 'continuous-video', // Android Only
EDOF: 'edof', // Android Only
INFINITY: 'infinity', // Android Only
MACRO: 'macro' // Android Only
};

EXPOSURE_MODE = {
LOCK: 'lock', // IOS Only
AUTO: 'auto', // IOS Only
CONTINUOUS: 'continuous',
Expand Down Expand Up @@ -265,6 +276,38 @@ export class CameraPreview extends IonicNativePlugin {
})
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }

/**
* Get focus mode
* @return {Promise<any>}
*/
@Cordova()
getFocusMode(): Promise<any> { return; }

/**
* Set the focus mode
* @param [focusMode] {string} 'fixed', 'auto', 'continuous-picture', 'continuous-video' (iOS & Android), 'edof', 'infinity', 'macro' (Android Only)
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
setFocusMode(focusMode?: string): Promise<any> { return; }

/**
* Get supported focus modes
* @return {Promise<any>}
*/
@Cordova()
getSupportedFocusModes(): Promise<any> { return; }

/**
* Get the current flash mode
* @return {Promise<any>}
*/
@Cordova()
getFlashMode(): Promise<any> { return; }

/**
* Set the flashmode
* @param [flashMode] {string} 'off' (iOS & Android), 'on' (iOS & Android), 'auto' (iOS & Android), 'torch' (Android)
Expand All @@ -277,18 +320,18 @@ export class CameraPreview extends IonicNativePlugin {
setFlashMode(flashMode?: string): Promise<any> { return; }

/**
* Get supported picture sizes
* Get supported flash modes
* @return {Promise<any>}
*/
@Cordova()
getSupportedPictureSizes(): Promise<any> { return; }
getSupportedFlashModes(): Promise<any> { return; }

/**
* Get supported flash modes
* Get supported picture sizes
* @return {Promise<any>}
*/
@Cordova()
getSupportedFlashModes(): Promise<any> { return; }
getSupportedPictureSizes(): Promise<any> { return; }

/**
* Get exposure mode
Expand Down

0 comments on commit 748c6bd

Please sign in to comment.