Skip to main content

Properties

info
  • Frameworks are using camelCase
  • Native tools (VanillaJS, WebComponent) are using dashed-case to match HTML attributes (and use string values)
PropertyTypeDefaultDescription
compositionUrlstring🚫 RequiredURL to the composition data
hideCategoriesNavbooleanfalseHide the category-based navigation
infiniteCarrouselbooleanfalseAllow to navigate from 1st to last media (and vice versa)
permanentGallerybooleanfalseDisplay gallery under the carrousel
mediaLoadStrategy"quality"
"balanced"
"speed"
"quality"Strategy for loading medias.
minMediaWidthnumber0Force minimum media width (in pixels)
maxMediaWidthnumberInfinityForce maximum media width (in pixels)
preloadRangenumber1Number of medias to preload before & after the viewport
autoLoad360booleanfalseLoad 360 images without having to click
categoriesFilterstring*Only display certain categories
extendBehavior"full_screen"
"event"
"none"
full_screenHandle extend mode
eventPrefixstring"cc-webplayer:"Prefix of cc-player events
demoSpinbooleanfalseRun a spin once the 360 images has been loaded
reverse360booleanfalseReverse the 360-degree rotation

Generate composition URL​

info

The composition URL could be any URL that returns a JSON object with the composition data.

In the following example, we are using a URL that is specific to the Car Cutter platform, but you can replace it with your own URL if you have a different backend.

import { generateCompositionUrl } from "@car-cutter/your-npm-package-webplayer";

/**
* @param {string} customerToken - The CarCutter Customer Token (computed by hasing the Customer ID with SHA-256).
* @param {string} vin - The Vehicle Identification Number.
* @returns {string} The URL to fetch the composition JSON.
*/
const compositionUrl = generateCompositionUrl(customerToken, vin);
note

In order to keep your Customer ID secret, we are using the Customer Token and not the Customer ID. Make sure to not include the Customer ID in your frontend code.

Categories Filter​

The categoriesFilter property allows you to filter which categories should be displayed in the WebPlayer. It supports wildcards (*) and multiple patterns separated by a vertical pipe (|).

// Only show categories named exactly "exterior" or "interior"
<WebPlayer categoriesFilter="exterior|interior" />
info

When categoriesFilter is not specified, it defaults to "*" which shows all categories.

Extend Behavior​

The extendBehavior property controls how the WebPlayer reacts when its extend button is clicked.

  • "full_screen": Uses the browser's Full Screen API when entering extend mode
  • "event": Triggers an event when extend mode is requested
  • "none": Hide the extend button and disable extend mode functionality
tip

When using "event" behavior, you can handle the extend mode in your own application using the onExtendModeOn callback (in React) or by listening to the extendModeOn event (in vanilla JavaScript).