To set up the AR visualization, the method setArSettings is used.
The following parameters can be sent:
Parameter |
Description |
preview |
A range of settings to customize the open button |
preview.html |
Button text |
preview.style.backgroundColor
preview.style.backgroundImage
preview.style.backgroundSize
preview.style.backgroundRepeat
preview.style.backgroundPosition
|
Button styles. All styles are written as style object properties |
viewer |
A number of settings to stylize the viewer |
viewer.modalStyle |
Pop-up styles. All styles are written as style object properties. |
viewer.viewerStyle |
Viewer styles. All styles are written as style object properties. |
viewer.loaderColor |
Pre-loader bar color |
viewer.closeStyle |
Viewer close button style. All styles are written as style object properties. |
qr |
A number of settings for QR code modal window |
qr.modal.style |
Modal window styles settings. All styles are written as style object properties. |
qr.box.style |
Settings of QR content block styles. All styles are written as style object properties. |
qr.btnOpen |
Settings of open button of QR code modal window |
qr.btnOpen.html |
Buton text |
qr.btnOpen.style |
Button styles. All styles are written as style object properties. |
qr.btnClose |
Settings of close button of QR code modal window |
qr.btnClose.html |
Button text |
qr.btnClose.style |
Button styles. All styles are written as style object properties. |
qr.title |
QR code title settings |
qr.title.html |
Title text |
qr.title.style |
Title styles. All styles are written as style object properties. |
qr.subtitle |
QR code subtitle settings |
qr.subtitle.html |
Subtitle text |
qr.subtitle.style |
Subtitle styles. All styles are written as style object properties. |
Code example
<script>
TTLStreamReady.then(() => {
ttlStream.setArSettings( {
preview: {
html: '',
style: {
backgroundColor: '#231010',
backgroundImage: "url('https://24ar.tech/staticCDN/desktop/assets/buttons/ar.svg')",
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
},
},
viewer: {
modalStyle: { },
viewerStyle: { },
loaderColor: '#bd0d0d',
closeStyle: { },
},
qr: {
modal: {
style: { },
},
box: {
style: { },
},
btnOpen: {
html: 'Hello world!',
style: { },
},
btnClose: {
html: 'Close',
style: { },
},
title: {
html: 'How to watch in AR',
style: { },
},
subtitle: {
html: 'Scan the QR code with your phone's camera to see the object in real life.',
style: { },
},
},
});
ttlStream.findAndInsert( {
el: '.myCoolWrapper',
brand: 'panasonic',
productId: 'demoSKU',
retailerDomain: 'beru.ru',
templateType: 'desktop',
resultType: 'html',
contentType: 'ar',
});
});
</script>