{"id":3551,"date":"2022-03-22T18:00:20","date_gmt":"2022-03-22T18:00:20","guid":{"rendered":"https:\/\/www.bennewitz.com\/devel\/?p=3551"},"modified":"2022-09-01T09:13:28","modified_gmt":"2022-09-01T09:13:28","slug":"virtual-mirror-api-revised","status":"publish","type":"post","link":"https:\/\/www.bennewitz.com\/devel\/virtual-mirror-api-revised\/","title":{"rendered":"Virtual Mirror HTML5 API Documentation &#8211; Second Revision"},"content":{"rendered":"<h3 style=\"text-align: center;\">A short explanation of the very simple API of Virtual Mirror HTML5<\/h3>\n<p>These parameters can be passed as key-value to Virtual Mirror HTML5, using GET:<\/p>\n<p><span style=\"color: #3366ff;\"><code>vmjs.html?frameFile=\/path\/file-name<\/code><\/span><br \/><span style=\"color: #ff0000;\"><i>frameFile=xxxxxxx<\/i><\/span><i> requires the location of a picture of the eyeglasses. For 3D *.glb or *.gltf is required, for 2D *.jpg or *.png. This should be loaded from the same domain. If no image was passed, Virtual Mirror will use a default image, defined inside of the configuration file.<br \/><\/i><br \/><span style=\"color: #3366ff;\"><code>vmjs.html?frameFile=\/path\/file-name&amp;frameSize=141<\/code><\/span><br \/><span style=\"color: #ff0000;\"><i>frameSize=xxx<\/i><\/span><i> is the frontal width of the eyeglasses by use of millimeters.<\/i><br \/><i>Based on this parameter the eyeglasses will be scaled by Virtual Mirror to match the real size.<\/i><br \/><i>If this parameter wasn&#8217;t passed Virtual Mirror will fall back to the default value of 135 mm. In result every eyeglasses will get the same size. So it&#8217;s important to pass this value.<br \/><\/i><br \/><span style=\"color: #3366ff;\"><code>vmjs.html?frameFile=\/path\/file-name&amp;frameSize=141&amp;frameName=Ray-Ban-Wayfarer<\/code><\/span><br \/><span style=\"color: #ff0000;\"><i>frameName=xxxxxxxxxxxxxxxx<\/i><\/span><i>\u00a0will be used for the file name of a screen shot, taken by customers and saved on their device. The value should be urlencoded to translate possible spaces. If the name of the eyeglasses wasn&#8217;t provided Virtual Mirror will use &#8216;me-and-my-glasses&#8217; instead as a fallback.<br \/><\/i><br \/><span style=\"color: #3366ff;\"><code>vmjs.html?frameFile=\/path\/file-name&amp;frameSize=141&amp;frameName=Ray-Ban-Wayfarer&amp;gender=male<\/code><\/span><br \/><span style=\"color: #ff0000;\"><i>gender=xxxxxx<\/i><\/span><i> will be used to change the default model by gender. Possible values are &#8220;female&#8221; and &#8220;male&#8221; , for children &#8220;girl&#8221; and &#8220;boy&#8221;. If the gender key-value pair isn&#8217;t provided Virtual Mirror will load the female model as a fallbac<\/i>k.<\/p>\n<p><span style=\"color: #3366ff;\"><code>vmjs.html?frameFile=\/path\/file-name&amp;frameSize=141&amp;frameName=Ray-Ban-Wayfarer&amp;gender=male&amp;lang=en<\/code><\/span><br \/><span style=\"color: #ff0000;\"><i>lang=xx<\/i><\/span><i> defines the language of the GUI of Virtual Mirror. The value has to be defined as ISO 639-1.<\/i><\/p>\n<p>Since January 2022 Virtual Mirror was translated to Arabic (<span style=\"color: #ff0000;\">ar<\/span>), German (<span style=\"color: #ff0000;\">de<\/span>), English (<span style=\"color: #ff0000;\">en<span style=\"color: #000000;\">), Spanish (<span style=\"color: #ff0000;\">es<\/span>), French (<span style=\"color: #ff0000;\">fr<\/span>), Greek (<span style=\"color: #ff0000;\">gr<\/span>), Hebrew (<span style=\"color: #ff0000;\">he<\/span>), Dutch (<span style=\"color: #ff0000;\">nl<\/span>), Portuguese (<span style=\"color: #ff0000;\">pt<\/span>), Romanian (<span style=\"color: #ff0000;\">ro<\/span>), Russian (<span style=\"color: #ff0000;\">ru<\/span>) and Slovenian (<span style=\"color: #ff0000;\">sl<\/span>). As a fallback Virtual Mirror tries to get the language by the language tag defined for that web page.<\/span><\/span><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A short explanation of the very simple API of Virtual Mirror HTML5 These parameters can be passed as key-value to Virtual Mirror HTML5, using GET: [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":3423,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[29],"tags":[],"class_list":["post-3551","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-virtual-try-for-mobile-devices"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.bennewitz.com\/devel\/wp-content\/uploads\/2018\/01\/mirror-api.png","_links":{"self":[{"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/posts\/3551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/comments?post=3551"}],"version-history":[{"count":0,"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/posts\/3551\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/media\/3423"}],"wp:attachment":[{"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/media?parent=3551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/categories?post=3551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bennewitz.com\/devel\/wp-json\/wp\/v2\/tags?post=3551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}