Comparing version 5.0.0-alpha-1 to 5.0.0-alpha-2
@@ -102,8 +102,21 @@ import { ARTouchInfo } from "./touchType"; | ||
/** | ||
* Starts the camera preview. By default, the camera will be user facing. | ||
* @param mirror Mirror the camera horizontally. | ||
* @param mediaStreamConstraints Options passed to MediaDevices.getUserMedia(). The default is the user facing camera. | ||
* Starts the camera preview. By default, the camera will be user facing. The returned promise will resolve after the camera starts | ||
* or it will reject if camera permission was denied. | ||
* @param cameraOptions Camera options. | ||
* @param cameraOptions.mirror Mirror the camera horizontally. True by default. | ||
* @param cameraOptions.mediaStreamConstraints Options passed to MediaDevices.getUserMedia(). The default is the user facing camera. | ||
* @param cameraOptions.cameraPermissionAsked Callback called when camera permission is asked. | ||
* @param cameraOptions.cameraPermissionGranted Callback called when camera permission is granted. | ||
*/ | ||
startCamera(mirror?: boolean, mediaStreamConstraints?: MediaStreamConstraints): void; | ||
startCamera(cameraOptions?: { | ||
mirror?: boolean; | ||
mediaStreamConstraints?: MediaStreamConstraints; | ||
cameraPermissionAsked: () => void; | ||
cameraPermissionGranted: () => void; | ||
}): Promise<void>; | ||
/** | ||
* Stops the camera preview. | ||
*/ | ||
stopCamera(): void; | ||
/** | ||
* Stops the camera preview or custom video preview set by {@link setVideoElement}. | ||
@@ -110,0 +123,0 @@ */ |
@@ -19,8 +19,9 @@ /** | ||
/** | ||
* Path to the root directory of the DeepAR SDK. Most often this is used to provide the path to the root of the CDN that hosts the DeepAR SDK. | ||
* For example "https://cdn.jsdelivr.net/npm/deepar@4.0.3/".<br> | ||
* Path to the root directory of the DeepAR SDK. This path will be used to locate and download all the additional needed files like ML models and wasm files. | ||
* By default, this points to the JsDelivr CDN. For example "https://cdn.jsdelivr.net/npm/deepar@4.0.3/".<br> | ||
* | ||
* If you want to host the DeepAR SDK yourself set the path to it here. It is recommended to host DeepAR SDK on your own since then you can use compressions like gzip and brotli on the files. | ||
* | ||
* > ⚠️ <b>Be sure that the version of DeepAR js file and the root SDK path match!</b> | ||
* | ||
* This path will be used to locate and download all the additional needed files like ML models. | ||
* DeepAR SDK can be hosted on any other server, but be sure not to change the directory and file structure of DeepAR SDK when hosing it.<br> | ||
@@ -32,17 +33,25 @@ * | ||
/** | ||
* TODO | ||
* Additional DeepAR options. | ||
*/ | ||
additionalOptions?: { | ||
/** | ||
* By default, DeepAR preview will use the user facing camera. With these options you can disable the default camera usage or change the facing mode. | ||
* Camera options. DeepAR will use the camera by default. | ||
*/ | ||
cameraConfig?: { | ||
/** | ||
* Can be "user" or "environment". User will be a front facing camera on mobile devices, while environment will be the back facing camera. | ||
* If true, DeepAR will not use camera preview by default and all the other options here are ignored in that case. You can use your own camera/video by calling {@link DeepAR.setVideoElement} or start the camera at any time by calling {@link DeepAR.startCamera} | ||
*/ | ||
disableDefaultCamera?: boolean; | ||
/** | ||
* Can be "user" or "environment". User will be a front facing camera on mobile devices, while environment will be the back facing camera. Default is "user". | ||
*/ | ||
facingMode?: string; | ||
/** | ||
* If true, DeepAR will not use camera preview by default. You can use your own camera/video by calling {@link DeepAR.setVideoElement} or start the camera at any time by calling {@link DeepAR.startCamera} | ||
* Called when the camera permission is asked. | ||
*/ | ||
disableDefaultCamera?: boolean; | ||
cameraPermissionAsked?: () => void; | ||
/** | ||
* Called when the camera permission is granted. | ||
*/ | ||
cameraPermissionGranted?: () => void; | ||
}; | ||
@@ -53,5 +62,7 @@ /** | ||
* <ul> | ||
* <li><b>face</b> - Will initialize face tracking as soon as possible. Without this hint face tracking is lazy loaded when some face tracking effect is loaded.</li> | ||
* <li><b>segmentation</b> - Will initialize segmentation as soon as possible. Without this hint segmentation is lazy loaded when some segmentation effect is loaded.</li> | ||
* <li><b>foot</b> - Will initialize foot tracking as soon as possible. Without this hint foot tracking is lazy loaded when some foot tracking effect is loaded.</li> | ||
* <li><b>faceModelsPredownload</b> - Will download the face models as soon as possible.</li> | ||
* <li><b>segmentationModelsPredownload</b> - Will download the segmentation models as soon as possible. Note - it will not try to initialize segmentation. Segmentation will be lazy loaded when needed.</li> | ||
* <li><b>footModelsPredownload</b> - Will download the foot models as soon as possible. Note - it will not try to initialize foot tracking. Foot tracking will be lazy loaded when needed.</li> | ||
* <li><b>segmentationInit</b> - Will initialize segmentation as soon as possible. Without this hint segmentation is lazy loaded when some segmentation effect is loaded.</li> | ||
* <li><b>footInit</b> - Will initialize foot tracking as soon as possible. Without this hint foot tracking is lazy loaded when some foot tracking effect is loaded.</li> | ||
* </ul> | ||
@@ -61,7 +72,7 @@ */ | ||
/** | ||
* TODO | ||
* Face tracking module path and options. | ||
*/ | ||
faceTrackingConfig?: { | ||
/** | ||
* TODO | ||
* Path to the face tracking model. Something like "path/to/deepar/models/face/models-68-extreme.bin". | ||
*/ | ||
@@ -71,7 +82,7 @@ modelPath: string; | ||
/** | ||
* Object containing configuration about the DeepAR segmentation which is used by background removal effects. | ||
* Segmentation module path and options. | ||
*/ | ||
segmentationConfig?: { | ||
/** | ||
* Path to the segmentation model. Something like "path/to/segmentation-192x192.bin". | ||
* Path to the segmentation model. Something like "path/to/deepar/models/segmentation/segmentation-192x192.bin". | ||
*/ | ||
@@ -81,24 +92,36 @@ modelPath: string; | ||
/** | ||
* Object containing configuration for DeepAR foot tracking which is used for virtual shoe try on. | ||
* Foot tracking module paths and options. | ||
*/ | ||
footTrackingConfig?: { | ||
/** | ||
* Path to the pose estimation wasm file, e.g. "/path/to/libPoseEstimation.wasm". | ||
* Path to the pose libPoseEstimation.wasm file, e.g. "/path/to/deepar/wasm/libPoseEstimation.wasm". | ||
*/ | ||
poseEstimationWasmPath?: string; | ||
/** | ||
* Path to the detector model, e.g. "/path/to/foot-detector-ios.bin". | ||
* Path to the detector model, e.g. "/path/to/deepar/models/foot/foot-detector.bin". | ||
*/ | ||
detectorPath?: string; | ||
/** | ||
* Path to the tracker model, e.g. "/path/to/foot-tracker-ios.bin". | ||
* Path to the tracker model, e.g. "/path/to/deepar/models/foot/foot-tracker.bin". | ||
*/ | ||
trackerPath?: string; | ||
/** | ||
* Path to the foot model object file, e.g. "/path/to/foot-model.obj". | ||
* Path to the foot model object file, e.g. "/path/to/deepar/models/foot/foot-model.obj". | ||
*/ | ||
objPath?: string; | ||
/** | ||
* Path to tfjs-backend-wasm.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm.wasm" | ||
*/ | ||
tfjsBackendWasmPath?: string; | ||
/** | ||
* Path to tfjs-backend-wasm-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-simd.wasm" | ||
*/ | ||
tfjsBackendWasmSimdPath?: string; | ||
/** | ||
* Path to tfjs-backend-wasm-threaded-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm" | ||
*/ | ||
tfjsBackendWasmThreadedSimdPath?: string; | ||
}; | ||
/** | ||
* Path to deepar.wasm file. Something like "path/to/deepar.wasm". | ||
* Path to deepar.wasm file. Something like "/path/to/deepar/wasm/deepar.wasm". | ||
*/ | ||
@@ -105,0 +128,0 @@ deeparWasmPath?: string; |
/** | ||
* DeepAR Web SDK version. | ||
*/ | ||
declare const version = "5.0.0-alpha-1"; | ||
declare const version = "5.0.0-alpha-2"; | ||
export { version }; |
{ | ||
"name": "deepar", | ||
"version": "5.0.0-alpha-1", | ||
"version": "5.0.0-alpha-2", | ||
"description": "The official DeepAR Web SDK", | ||
@@ -5,0 +5,0 @@ "main": "js/deepar.esm.js", |
@@ -193,3 +193,5 @@ # deepar | ||
additionalOptions: { | ||
disableDefaultCamera: true | ||
cameraConfig: { | ||
disableDefaultCamera: true | ||
} | ||
} | ||
@@ -210,3 +212,5 @@ }); | ||
additionalOptions: { | ||
disableDefaultCamera: true | ||
cameraConfig: { | ||
disableDefaultCamera: true | ||
} | ||
} | ||
@@ -216,3 +220,3 @@ }); | ||
// When you want to ask the camera permission and start the camera. | ||
deepAR.startCamera(); | ||
await deepAR.startCamera(); | ||
``` | ||
@@ -219,0 +223,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20612414
224
29
8056
53