mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-13 14:21:04 +08:00
feat(camera-preview): add new focus methods & getFlashMode() (#1442)
4 new methods are available in the master: - getSupportedFocusModes(); - getFocusMode(); - seFocusMode(); - getFlashMode();
This commit is contained in:
parent
1a682bc3de
commit
748c6bd9be
@ -134,7 +134,18 @@ export interface CameraPreviewPictureOptions {
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class CameraPreview extends IonicNativePlugin {
|
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
|
LOCK: 'lock', // IOS Only
|
||||||
AUTO: 'auto', // IOS Only
|
AUTO: 'auto', // IOS Only
|
||||||
CONTINUOUS: 'continuous',
|
CONTINUOUS: 'continuous',
|
||||||
@ -265,6 +276,38 @@ export class CameraPreview extends IonicNativePlugin {
|
|||||||
})
|
})
|
||||||
setPreviewSize(dimensions?: CameraPreviewDimensions): Promise<any> { return; }
|
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
|
* Set the flashmode
|
||||||
* @param [flashMode] {string} 'off' (iOS & Android), 'on' (iOS & Android), 'auto' (iOS & Android), 'torch' (Android)
|
* @param [flashMode] {string} 'off' (iOS & Android), 'on' (iOS & Android), 'auto' (iOS & Android), 'torch' (Android)
|
||||||
@ -276,13 +319,6 @@ export class CameraPreview extends IonicNativePlugin {
|
|||||||
})
|
})
|
||||||
setFlashMode(flashMode?: string): Promise<any> { return; }
|
setFlashMode(flashMode?: string): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Get supported picture sizes
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
@Cordova()
|
|
||||||
getSupportedPictureSizes(): Promise<any> { return; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get supported flash modes
|
* Get supported flash modes
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
@ -290,6 +326,13 @@ export class CameraPreview extends IonicNativePlugin {
|
|||||||
@Cordova()
|
@Cordova()
|
||||||
getSupportedFlashModes(): Promise<any> { return; }
|
getSupportedFlashModes(): Promise<any> { return; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get supported picture sizes
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getSupportedPictureSizes(): Promise<any> { return; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get exposure mode
|
* Get exposure mode
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user