@vizor-vr/shared

v0.4.0

Published

Shared types, constants, and utilities for Vizor VR Player

Readme

@vizor-vr/shared

Shared types, constants, and utilities used across the Vizor VR packages and platform — projection-format definitions, license tiers and feature flags, event types, and small VR math helpers.

Install

npm install @vizor-vr/shared

Usage

import { VzFormat, FORMAT_REGISTRY, TIER_FEATURES, type LicenseTier } from '@vizor-vr/shared';

This package is primarily an internal dependency of the Vizor packages; it is published so the framework wrappers and player share a single source of truth for types and constants. The most stable, consumer-facing surface is the formats, events, and player-config types below — the plan/pricing/analytics exports serve the Vizor platform itself and may change with the platform.

Exports

Formats

  • VzFormat — enum of all projection formats (MONO_360, STEREO_360_TB, STEREO_180_LR, MONO_FISHEYE, MONO_FLAT, …), also exported as the VzFormatEnum alias
  • FORMAT_REGISTRY, getFormatMeta(format), parseFormat(str) — format metadata and safe string parsing
  • Types: ProjectionType, StereoMode, FormatMeta

Player configuration

  • DEFAULT_CONFIG — default PlayerConfig values used by the player elements
  • SPHERE_DEFAULTS, CAMERA_DEFAULTS, CONTROLS_HIDE_TIMEOUT — renderer/camera/UI defaults
  • PLAYER_VERSION, PLAYER_CDN_SCRIPT_URL — the published player version and its pinned CDN bundle URL
  • DEFAULT_KEYBINDINGS, SEEK_STEP, SEEK_STEP_LARGE, VOLUME_STEP, PLAYBACK_RATE_STEP — keyboard-shortcut defaults
  • Types: PlayerConfig, PlaybackState, RendererState, QualityLevel, VzError, ParsedSource

Events

  • MEDIA_EVENTS, CUSTOM_EVENTS — runtime lists of the HTML5 media events the player mirrors and the vz-* CustomEvents it emits
  • Types: VzMediaEvent, VzCustomEvent, VzEvent, VzEventDetailMap (event name → detail payload)

Licensing and plans

  • TIER_FEATURES, getFeaturesForTier(tier), TIER_QUOTAS — feature flags and quotas per license tier
  • TIER_PRICING, TIER_MEDIA, MEDIA_OVERAGE, getMediaLimits(tier) — pricing and media limits
  • Seed-plan helpers: getSeedPlan, getPlayerSeedPlan, getSeedPlanByKey, basePlanTier, planTierRank, SEED_PLAN_KEYS, PLAYER_SEED_PLAN_KEYS, ALL_SEED_PLAN_KEYS
  • Types: LicenseTier, LicenseMode, LicenseResult, FeatureFlags, ProductType, PlanQuotas, PlanOverageRates, SeedPlan, PlayerPlanKey, TierPrice, MediaTierLimits

Content and delivery types

  • Tours: TourProbe, TourPortal
  • Annotations: AnnotationData
  • Hosted delivery payloads: DeliveryContentConfig, DeliveryAnnotation, DeliveryCaption, DeliveryChapter, DeliveryDrm, DeliveryTourConfig, DeliveryTourProbe, DeliveryTourPortal, DeliveryPlaylistConfig, DeliveryPlaylistItem
  • Analytics: AnalyticsEventType, AnalyticsEvent, AnalyticsBatch, GazeSample, GazeBatch (plus batching-interval constants ANALYTICS_BATCH_INTERVAL, GAZE_SAMPLE_INTERVAL, GAZE_BATCH_INTERVAL)
  • Collaborative viewing: CollabParticipant, ClientMessage, ServerMessage (plus COLLAB_GAZE_* tuning constants)

Math utilities

degToRad, radToDeg, clamp, lerp, latLonToSpherical, sphericalToLatLon, normalizeAngle.

Documentation

Full docs: docs.vizor-vr.com. Source lives in the vizor-vr monorepo on GitHub.

Security

See the monorepo security policy for how to report vulnerabilities ([email protected]).

License

MIT — see LICENSE.