Instance Methods
arguments |
sample value
|
description
|
Example
|
||
---|---|---|---|---|---|
glassesId (required) |
string
|
Frame's unique client reference See Requirements > glassesId |
This example load a frame when fitmix is ready but setFrame can be called anytime after fitmix is ready
|
<!-- HTML Content --> <!-- Let 's assume we have created a fitmixInstance (with the FitMix.createWidget function documented above)--> <!-- This button will load the frame with the id 1703-433490--> <button onclick="fitmixInstance.setFrame(' 1703-433490')">Load frame 1703-433490</button> |
arguments |
sample value
|
description
|
Example
|
||
---|---|---|---|---|---|
lang (required) |
String
|
language code: Name in English/Name in French 'bg' - Bulgarian / Bulgare |
This example loads a frame when fitmix is ready setFrame can be called anytime as long as fitmixInstance is ready
|
arguments |
sample value
|
description
|
Example
|
||
---|---|---|---|---|---|
callback (required) |
function callback
|
callback function called after the disposal of the fitmix widget you can safely remove the widget parent html element from the html page in this callback code
This function may be used when you want to remove the fitmixInstance from the page |
This example loads a frame when fitmix is ready but setFrame can be called any time after fitmix is ready
|
var params = { apiKey: 'TBVAcXitApiZPVH791yxdHbAc8AKzBwtCnjtv6Xn' , onSnapshot: onSnapshot, }; fitmixInstance = FitMix.createWidget( 'my-fitmix-container' , params, function () { fitmixInstance.setFrame( '1703-433490' ); }); function onSnapshot(dataB64) { var img = document.getElementById( "my-snapshot" ); img.src = data.dataURL; } function getSnapshot() { fitmixInstance.getSnapshot(); } |
var params = { apiKey: 'TBVAcXitApiZPVH791yxdHbAc8AKzBwtCnjtv6Xn' }; fitmixInstance = FitMix.createWidget( 'my-fitmix-container' , params, function () { fitmixInstance.setFrame( '1703-433490' ); }); function setTryonPicture(data) { fitmixInstance.setTryonPicture(data); } |
var params = { apiKey: 'TBVAcXitApiZPVH791yxdHbAc8AKzBwtCnjtv6Xn' , }; fitmixInstance = FitMix.createWidget( 'my-fitmix-container' , params, function () { fitmixInstance.setFrame( '1703-433490' ); }); var hide = function () { document.getElementById( 'my-fitmix-container' ).style.display = 'none' ; // hide fitmix container fitmixInstance.pauseStream(); // stop camera, stop detection and tracking }; var show = function () { document.getElementById( 'my-fitmix-container' ).style.display = 'block' ; // show fitmix container fitmixInstance.resumeStream(); // get the camera stream back }; |
var params = { apiKey: 'TBVAcXitApiZPVH791yxdHbAc8AKzBwtCnjtv6Xn' , }; fitmixInstance = FitMix.createWidget( 'my-fitmix-container' , params, function () { fitmixInstance.setFrame( '1703-433490' ); fitmixInstance.setLensesAntireflection( true ); }) |
It is possible to guarantee the size of a frame tried-on by a user, by entering their pupillary distance or their gender.
Through this feature, Fittingbox Virtual Try-On can render a frame with guaranteed realistic size and fit.
The default pupillary distance is set to 63 mm.
For the most accurate virtual try-on, it is possible to offer a user the possibility of entering their precise pupillary distance by setting in Fittingbox Virtual Try-On the following parameter:
fitmixInstance.setPupillaryDistance(59); // pupillary distance in millimeters}) |
If the user does not know their pupillary distance, it is possible to guarantee a more accurate virtual try-on than the standard by using statistical data based on the gender of the user.
You can set the possibility for the user to enter their gender by setting in Fittingbox Virtual Try-On the following parameter:
fitmixInstance.setUserInfo({gender: 'f'}); // female user |
Request a free demo, a free quote or set up an appointment with one of our sales representatives.
CONTACT US© FITTINGBOX 2024 • Terms of use • Privacy & Legal