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
hideCategoriesbooleanfalseHide 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
preventFullScreenbooleanfalseWhether to prevent full screen mode
eventPrefixstring"cc-webplayer:"Prefix of cc-player events
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.