Install
Install the framework-independent package:ResizeObserver, pointer events and AbortController.
Create a player
Give the player a container. It fills the container width and derives its height from the displayed media.Load report data
Choose one data-loading route.report takes precedence over token, and fetchReport takes precedence over the built-in request.
jwt for reports that require a JWT. The built-in loader sends it as X-JWT and retries anonymously if the request returns 401.
Configure the player
Pass configuration when you create the player. These defaults match the Player 360 embed contract.
The available
TabId values are 360, exterior, interior, interior360, others and damages.
Use iframe-compatible query parameters
Query parameters are off by default. Enable them when you want the SDK to follow the iframe embed contract. Query values then take precedence over supplied options, which take precedence over defaults.?tabview=360&hotspot=false&excludeTab=interior,damages overrides the corresponding options.
Control the player
The instance exposes methods for navigation and playback.showSlide() uses one global slide list, ordered exterior, interior, interior 360°, others and damages. The player automatically switches to the matching view.
Read the active state with player.currentView, player.tabs, player.frame and player.currentReport.
Subscribe to events
Attach listeners immediately after creating the player. Initial events are emitted in a microtask, so the listener receivesready.
on, off and once are chainable. framechange can fire about 30 times a second during autoplay, so sample it before rendering UI from it.
To replace sharing entirely, prevent the default behaviour:
Use a framework binding
The core player has bindings for React, Vue and Angular. They all expose the same options and events as@carhub/player.
true; set attribute="false" to disable it.
Theme and translate labels
Set CSS custom properties on the host element. They cross the Shadow DOM boundary.data-theme="light" or data-theme="dark" on the host element to fix the theme. Without it, the player follows the user’s colour-scheme preference.
The player humanises damage and vehicle-part keys by default. Install the optional i18n export for the complete five-language dictionary:
Add interior panoramas
RICOH THETA equirectangular images use Photo Sphere Viewer. Install its optional peer dependencies to render them as interactive panoramas:Migrate from the iframe
Replace the iframe with a container and SDK instance. Configuration names and defaults are compatible. EnablereadQueryParams if you want existing URL query parameters to continue controlling the player.