@vizor-vr/player 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/__tests__/autoplay.test.d.ts +2 -0
- package/dist/__tests__/autoplay.test.d.ts.map +1 -0
- package/dist/__tests__/chapter-logic.test.d.ts +2 -0
- package/dist/__tests__/chapter-logic.test.d.ts.map +1 -0
- package/dist/__tests__/chapter-manager.test.d.ts +2 -0
- package/dist/__tests__/chapter-manager.test.d.ts.map +1 -0
- package/dist/__tests__/chapter-menu.test.d.ts +2 -0
- package/dist/__tests__/chapter-menu.test.d.ts.map +1 -0
- package/dist/__tests__/dom-drm.test.d.ts +2 -0
- package/dist/__tests__/dom-drm.test.d.ts.map +1 -0
- package/dist/__tests__/drm-gate.test.d.ts +2 -0
- package/dist/__tests__/drm-gate.test.d.ts.map +1 -0
- package/dist/__tests__/fairplay.test.d.ts +2 -0
- package/dist/__tests__/fairplay.test.d.ts.map +1 -0
- package/dist/__tests__/hub-controller.test.d.ts +2 -0
- package/dist/__tests__/hub-controller.test.d.ts.map +1 -0
- package/dist/__tests__/hub-layout.test.d.ts +2 -0
- package/dist/__tests__/hub-layout.test.d.ts.map +1 -0
- package/dist/__tests__/hub-model.test.d.ts +2 -0
- package/dist/__tests__/hub-model.test.d.ts.map +1 -0
- package/dist/__tests__/hub-panel-renderer.test.d.ts +2 -0
- package/dist/__tests__/hub-panel-renderer.test.d.ts.map +1 -0
- package/dist/__tests__/lens-angle.test.d.ts +2 -0
- package/dist/__tests__/lens-angle.test.d.ts.map +1 -0
- package/dist/__tests__/media-element-drm-gate.test.d.ts +2 -0
- package/dist/__tests__/media-element-drm-gate.test.d.ts.map +1 -0
- package/dist/__tests__/media-element-gating.test.d.ts +2 -0
- package/dist/__tests__/media-element-gating.test.d.ts.map +1 -0
- package/dist/__tests__/player-version-lock.test.d.ts +2 -0
- package/dist/__tests__/player-version-lock.test.d.ts.map +1 -0
- package/dist/__tests__/source-manager-drm.test.d.ts +2 -0
- package/dist/__tests__/source-manager-drm.test.d.ts.map +1 -0
- package/dist/__tests__/vz-chapter.test.d.ts +2 -0
- package/dist/__tests__/vz-chapter.test.d.ts.map +1 -0
- package/dist/__tests__/vz-cinema-gating.test.d.ts +2 -0
- package/dist/__tests__/vz-cinema-gating.test.d.ts.map +1 -0
- package/dist/__tests__/vz-hub-item.test.d.ts +2 -0
- package/dist/__tests__/vz-hub-item.test.d.ts.map +1 -0
- package/dist/__tests__/vz-tour-gating.test.d.ts +2 -0
- package/dist/__tests__/vz-tour-gating.test.d.ts.map +1 -0
- package/dist/__tests__/watch-time.test.d.ts +2 -0
- package/dist/__tests__/watch-time.test.d.ts.map +1 -0
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/annotations/annotation-popup.d.ts.map +1 -1
- package/dist/{annotations-C0ugfCn4.js → annotations-Du6ZWrqC.js} +82 -13
- package/dist/annotations-Du6ZWrqC.js.map +1 -0
- package/dist/captions/caption-renderer.d.ts.map +1 -1
- package/dist/{captions-BP0H2E03.js → captions-YvnHAwLY.js} +4 -4
- package/dist/captions-YvnHAwLY.js.map +1 -0
- package/dist/chapters/chapter-logic.d.ts +47 -0
- package/dist/chapters/chapter-logic.d.ts.map +1 -0
- package/dist/chapters/chapter-manager.d.ts +42 -0
- package/dist/chapters/chapter-manager.d.ts.map +1 -0
- package/dist/chapters/chapter-menu.d.ts +24 -0
- package/dist/chapters/chapter-menu.d.ts.map +1 -0
- package/dist/{collab-BXPomrS0.js → collab-BLpllHtb.js} +20 -14
- package/dist/collab-BLpllHtb.js.map +1 -0
- package/dist/collaborative/chat-button.d.ts.map +1 -1
- package/dist/collaborative/voice-button.d.ts.map +1 -1
- package/dist/controls/cc-button.d.ts.map +1 -1
- package/dist/controls/compass.d.ts.map +1 -1
- package/dist/controls/controls-overlay.d.ts.map +1 -1
- package/dist/controls/fullscreen-button.d.ts.map +1 -1
- package/dist/controls/icons.d.ts +1 -0
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/live-indicator.d.ts.map +1 -1
- package/dist/controls/play-button.d.ts.map +1 -1
- package/dist/controls/playlist-controls.d.ts.map +1 -1
- package/dist/controls/quality-menu.d.ts.map +1 -1
- package/dist/controls/seek-bar.d.ts +9 -0
- package/dist/controls/seek-bar.d.ts.map +1 -1
- package/dist/controls/volume-control.d.ts.map +1 -1
- package/dist/controls/vr-button.d.ts.map +1 -1
- package/dist/core/base-element.d.ts +8 -0
- package/dist/core/base-element.d.ts.map +1 -1
- package/dist/core/media-element.d.ts +70 -1
- package/dist/core/media-element.d.ts.map +1 -1
- package/dist/{dash-adapter-tid9ZyhO.js → dash-adapter-BMpHWcBA.js} +9 -2
- package/dist/dash-adapter-BMpHWcBA.js.map +1 -0
- package/dist/delivery/__tests__/delivery-client.test.d.ts +2 -0
- package/dist/delivery/__tests__/delivery-client.test.d.ts.map +1 -0
- package/dist/delivery/__tests__/delivery-hydrate.test.d.ts +2 -0
- package/dist/delivery/__tests__/delivery-hydrate.test.d.ts.map +1 -0
- package/dist/delivery/delivery-client.d.ts +27 -0
- package/dist/delivery/delivery-client.d.ts.map +1 -0
- package/dist/delivery/delivery-hydrate.d.ts +18 -0
- package/dist/delivery/delivery-hydrate.d.ts.map +1 -0
- package/dist/delivery/dom-drm.d.ts +9 -0
- package/dist/delivery/dom-drm.d.ts.map +1 -0
- package/dist/elements/vz-chapter.d.ts +27 -0
- package/dist/elements/vz-chapter.d.ts.map +1 -0
- package/dist/elements/vz-cinema.d.ts +20 -0
- package/dist/elements/vz-cinema.d.ts.map +1 -1
- package/dist/elements/vz-hub-item.d.ts +23 -0
- package/dist/elements/vz-hub-item.d.ts.map +1 -0
- package/dist/elements/vz-hub.d.ts +57 -0
- package/dist/elements/vz-hub.d.ts.map +1 -0
- package/dist/elements/vz-playlist.d.ts +14 -0
- package/dist/elements/vz-playlist.d.ts.map +1 -1
- package/dist/elements/vz-tour.d.ts +16 -0
- package/dist/elements/vz-tour.d.ts.map +1 -1
- package/dist/hls-adapter-C_a65zia.js +161 -0
- package/dist/hls-adapter-C_a65zia.js.map +1 -0
- package/dist/hub/hub-controller.d.ts +31 -0
- package/dist/hub/hub-controller.d.ts.map +1 -0
- package/dist/hub/hub-layout.d.ts +23 -0
- package/dist/hub/hub-layout.d.ts.map +1 -0
- package/dist/hub/hub-model.d.ts +27 -0
- package/dist/hub/hub-model.d.ts.map +1 -0
- package/dist/hub/hub-panel-manager.d.ts +16 -0
- package/dist/hub/hub-panel-manager.d.ts.map +1 -0
- package/dist/hub/hub-panel-renderer.d.ts +26 -0
- package/dist/hub/hub-panel-renderer.d.ts.map +1 -0
- package/dist/license/__tests__/cache.test.d.ts +2 -0
- package/dist/license/__tests__/cache.test.d.ts.map +1 -0
- package/dist/license/__tests__/feature-gate.test.d.ts +2 -0
- package/dist/license/__tests__/feature-gate.test.d.ts.map +1 -0
- package/dist/license/__tests__/format-gate.test.d.ts +2 -0
- package/dist/license/__tests__/format-gate.test.d.ts.map +1 -0
- package/dist/license/__tests__/license-checker.test.d.ts.map +1 -0
- package/dist/license/__tests__/master-key.test.d.ts.map +1 -0
- package/dist/license/__tests__/verify-no-ed25519.test.d.ts +2 -0
- package/dist/license/__tests__/verify-no-ed25519.test.d.ts.map +1 -0
- package/dist/license/__tests__/verify.test.d.ts +2 -0
- package/dist/license/__tests__/verify.test.d.ts.map +1 -0
- package/dist/license/cache.d.ts +4 -0
- package/dist/license/cache.d.ts.map +1 -0
- package/dist/license/drm-gate.d.ts +15 -0
- package/dist/license/drm-gate.d.ts.map +1 -0
- package/dist/license/feature-gate.d.ts +27 -0
- package/dist/license/feature-gate.d.ts.map +1 -0
- package/dist/license/format-gate.d.ts +23 -0
- package/dist/license/format-gate.d.ts.map +1 -0
- package/dist/license/license-checker.d.ts.map +1 -1
- package/dist/license/master-key.d.ts +11 -7
- package/dist/license/master-key.d.ts.map +1 -1
- package/dist/license/trusted-key.d.ts +7 -0
- package/dist/license/trusted-key.d.ts.map +1 -0
- package/dist/license/verify.d.ts +7 -0
- package/dist/license/verify.d.ts.map +1 -0
- package/dist/{register-CwnmiGEs.js → register-BmZt_300.js} +1482 -163
- package/dist/register-BmZt_300.js.map +1 -0
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +1 -1
- package/dist/renderer/camera-controller.d.ts +1 -1
- package/dist/renderer/camera-controller.d.ts.map +1 -1
- package/dist/renderer/projections/fisheye-projection.d.ts +4 -0
- package/dist/renderer/projections/fisheye-projection.d.ts.map +1 -1
- package/dist/renderer/projections/spherical-projection.d.ts +26 -0
- package/dist/renderer/projections/spherical-projection.d.ts.map +1 -0
- package/dist/renderer/renderer.d.ts.map +1 -1
- package/dist/renderer/shaders/fisheye.glsl.d.ts +10 -1
- package/dist/renderer/shaders/fisheye.glsl.d.ts.map +1 -1
- package/dist/sri.json +8 -8
- package/dist/streaming/dash-adapter.d.ts +2 -2
- package/dist/streaming/dash-adapter.d.ts.map +1 -1
- package/dist/streaming/fairplay.d.ts +21 -0
- package/dist/streaming/fairplay.d.ts.map +1 -0
- package/dist/streaming/hls-adapter.d.ts +2 -2
- package/dist/streaming/hls-adapter.d.ts.map +1 -1
- package/dist/streaming/progressive-adapter.d.ts +2 -2
- package/dist/streaming/progressive-adapter.d.ts.map +1 -1
- package/dist/streaming/source-manager.d.ts +3 -1
- package/dist/streaming/source-manager.d.ts.map +1 -1
- package/dist/streaming/types.d.ts +9 -3
- package/dist/streaming/types.d.ts.map +1 -1
- package/dist/styles/controls.d.ts +1 -1
- package/dist/styles/controls.d.ts.map +1 -1
- package/dist/utils/static-html.d.ts +12 -0
- package/dist/utils/static-html.d.ts.map +1 -0
- package/dist/vizor.js +4 -4
- package/package.json +8 -5
- package/dist/__tests__/license-checker.test.d.ts.map +0 -1
- package/dist/__tests__/master-key.test.d.ts.map +0 -1
- package/dist/annotations-C0ugfCn4.js.map +0 -1
- package/dist/captions-BP0H2E03.js.map +0 -1
- package/dist/collab-BXPomrS0.js.map +0 -1
- package/dist/dash-adapter-tid9ZyhO.js.map +0 -1
- package/dist/hls-adapter-BivH46L_.js +0 -97
- package/dist/hls-adapter-BivH46L_.js.map +0 -1
- package/dist/register-CwnmiGEs.js.map +0 -1
- /package/dist/{__tests__ → license/__tests__}/license-checker.test.d.ts +0 -0
- /package/dist/{__tests__ → license/__tests__}/master-key.test.d.ts +0 -0
|
@@ -11,6 +11,16 @@ import { SourceManager } from '../streaming/source-manager.js';
|
|
|
11
11
|
* - HTML5 Media API mirroring
|
|
12
12
|
* - Controls overlay rendering
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* WS-D autoplay: honor the browser muted-autoplay policy. Autoplay without
|
|
16
|
+
* muted is force-muted (with a console.info) — browsers block audible
|
|
17
|
+
* autoplay — and playback is attempted ONCE when the video can play; a
|
|
18
|
+
* rejected play() promise is swallowed (the poster/controls remain usable).
|
|
19
|
+
*/
|
|
20
|
+
export declare function applyAutoplayPolicy(video: HTMLVideoElement, config: {
|
|
21
|
+
autoplay?: boolean;
|
|
22
|
+
muted: boolean;
|
|
23
|
+
}): void;
|
|
14
24
|
export declare abstract class VzMediaElement extends VzBaseElement {
|
|
15
25
|
protected renderer: VzRenderer;
|
|
16
26
|
protected videoElement: HTMLVideoElement;
|
|
@@ -34,6 +44,8 @@ export declare abstract class VzMediaElement extends VzBaseElement {
|
|
|
34
44
|
private liveIndicator;
|
|
35
45
|
private analyticsHandle;
|
|
36
46
|
private annotationManager;
|
|
47
|
+
private chapterManager;
|
|
48
|
+
private pendingChapters;
|
|
37
49
|
private captionRenderer;
|
|
38
50
|
private ccButton;
|
|
39
51
|
private collabClient;
|
|
@@ -43,11 +55,62 @@ export declare abstract class VzMediaElement extends VzBaseElement {
|
|
|
43
55
|
private chatButton;
|
|
44
56
|
private voiceManager;
|
|
45
57
|
private voiceButton;
|
|
58
|
+
private drmConfig;
|
|
59
|
+
private deferredDrmSources;
|
|
60
|
+
/**
|
|
61
|
+
* A content-id embed (`<vz-video content-id api-key>` with no DOM `<source>`)
|
|
62
|
+
* fetches its config from the delivery API and injects the equivalent
|
|
63
|
+
* `<source>`/`<vz-annotation>`/`<track>` DOM children before onConnected() runs
|
|
64
|
+
* — so authored content actually reaches the viewer. A DOM-authored embed
|
|
65
|
+
* (any `<source>` child) wins and skips the fetch entirely.
|
|
66
|
+
*/
|
|
67
|
+
protected beforeConnect(): Promise<void> | void;
|
|
68
|
+
private hydrateFromDeliveryApi;
|
|
46
69
|
protected onConnected(): void;
|
|
47
70
|
protected onDisconnected(): void;
|
|
48
71
|
protected onResize(): void;
|
|
49
|
-
/** After license resolves, enforce theme
|
|
72
|
+
/** After license resolves, enforce theme + format/feature tier gating */
|
|
50
73
|
protected onLicenseResolved(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Manual chapters are a paid feature. Once the license is known, wire the
|
|
76
|
+
* chapter UI (seek-bar markers + menu) and active-chapter tracking that fires
|
|
77
|
+
* `vz-chapter-change`, but only when the tier includes chapters. Unlicensed
|
|
78
|
+
* tiers degrade gracefully: no markers, no menu, no event (the video plays
|
|
79
|
+
* unaffected).
|
|
80
|
+
*/
|
|
81
|
+
private applyChaptersGate;
|
|
82
|
+
/**
|
|
83
|
+
* WebXR (Enter-VR) is a paid feature. Once the license is known, if the tier
|
|
84
|
+
* doesn't include it, remove the VR button so it can't be used — flat/pointer
|
|
85
|
+
* viewing continues unaffected (graceful downgrade). Licensed users keep the
|
|
86
|
+
* button, which reveals itself only when the device reports XR support.
|
|
87
|
+
*/
|
|
88
|
+
private applyWebxrGate;
|
|
89
|
+
/**
|
|
90
|
+
* Spatial (ambisonic) audio is a paid feature. When the source is authored as
|
|
91
|
+
* ambix and the tier includes it, wire up the AudioManager here (license is
|
|
92
|
+
* now known). When the tier lacks it, we do nothing — the hidden <video>'s
|
|
93
|
+
* own audio track plays as ordinary stereo, the graceful fallback.
|
|
94
|
+
*/
|
|
95
|
+
private applySpatialAudioGate;
|
|
96
|
+
/**
|
|
97
|
+
* Enforce format tier gating once the license is known. A stereo format the
|
|
98
|
+
* tier doesn't include is downgraded to its mono equivalent (re-projecting if
|
|
99
|
+
* the renderer already set up the ungated one); a format with no fallback (a
|
|
100
|
+
* 180 half-sphere) is blocked behind an upgrade overlay. Prevents free users
|
|
101
|
+
* from silently receiving paid formats.
|
|
102
|
+
*/
|
|
103
|
+
private applyFormatGate;
|
|
104
|
+
private showFormatUpgradeOverlay;
|
|
105
|
+
private showUpgradeOverlay;
|
|
106
|
+
/**
|
|
107
|
+
* DRM assets are encrypted-only (no plain fallback). Once the license is known:
|
|
108
|
+
* a tier WITHOUT `drm` is blocked behind an upgrade overlay (and NO license
|
|
109
|
+
* request is made); a licensed tier performs the deferred encrypted source load
|
|
110
|
+
* with the DRM context (license URLs + api-key) so the adapter can drive EME.
|
|
111
|
+
* EME/CDM errors during playback surface via the adapter's existing error events.
|
|
112
|
+
*/
|
|
113
|
+
private applyDrmGate;
|
|
51
114
|
protected onAttributeChanged(name: string, _oldVal: string | null, _newVal: string | null): void;
|
|
52
115
|
play(): Promise<void>;
|
|
53
116
|
pause(): void;
|
|
@@ -69,6 +132,12 @@ export declare abstract class VzMediaElement extends VzBaseElement {
|
|
|
69
132
|
protected abstract onMediaDisconnected(): void;
|
|
70
133
|
/** Parse <vz-annotation> children and create annotation manager if any exist */
|
|
71
134
|
private initAnnotations;
|
|
135
|
+
/**
|
|
136
|
+
* Parse `<vz-chapter>` children into a normalized pending list. The chapter UI
|
|
137
|
+
* (markers/menu/event) is wired later in applyChaptersGate() once the license
|
|
138
|
+
* is known, since chapters are tier-gated.
|
|
139
|
+
*/
|
|
140
|
+
private initChapters;
|
|
72
141
|
/** Initialize collaborative viewing if collab attributes are set */
|
|
73
142
|
private initCollab;
|
|
74
143
|
/** Initialize caption system from <track> children */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-element.d.ts","sourceRoot":"","sources":["../../src/core/media-element.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBA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Ib,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxB,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,CAAC,CAAC,EAAE,MAAM,EAExB;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM,EAEnB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,EAEnB;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,YAAY,CAAC,CAAC,EAAE,MAAM,EAEzB;IAED,gBAAgB,IAAI,IAAI;IAQxB,2DAA2D;IAC3D,WAAW,IAAI,UAAU;IAMzB,SAAS,CAAC,QAAQ,CAAC,gBAAgB,IAAI,IAAI;IAC3C,SAAS,CAAC,QAAQ,CAAC,mBAAmB,IAAI,IAAI;IAI9C,gFAAgF;IAChF,OAAO,CAAC,eAAe;IA4BvB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAepB,oEAAoE;IACpE,OAAO,CAAC,UAAU;IAuHlB,sDAAsD;IACtD,OAAO,CAAC,YAAY;IAqBpB,OAAO,CAAC,kBAAkB;IA6B1B,qDAAqD;IACrD,gBAAgB,IAAI,aAAa;IAIjC,uDAAuD;IACvD,OAAO,CAAC,WAAW;IA2CnB,4EAA4E;IAC5E,OAAO,CAAC,iBAAiB;IAmBzB,mEAAmE;IACnE,OAAO,CAAC,kBAAkB;CAgB3B"}
|
|
@@ -13,7 +13,7 @@ class DashAdapter {
|
|
|
13
13
|
this.videoElement = videoElement;
|
|
14
14
|
this._isAttached = true;
|
|
15
15
|
}
|
|
16
|
-
async load(url) {
|
|
16
|
+
async load(url, drm) {
|
|
17
17
|
if (!this.videoElement) return;
|
|
18
18
|
try {
|
|
19
19
|
const dashjs = await import("dashjs");
|
|
@@ -21,6 +21,13 @@ class DashAdapter {
|
|
|
21
21
|
this.player.destroy();
|
|
22
22
|
}
|
|
23
23
|
const player = dashjs.MediaPlayer().create();
|
|
24
|
+
if (drm) {
|
|
25
|
+
const headers = drm.apiKey ? { "x-api-key": drm.apiKey } : void 0;
|
|
26
|
+
player.setProtectionData({
|
|
27
|
+
"com.widevine.alpha": { serverURL: drm.config.licenseUrls.widevine, httpRequestHeaders: headers },
|
|
28
|
+
"com.microsoft.playready": { serverURL: drm.config.licenseUrls.playready, httpRequestHeaders: headers }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
24
31
|
player.initialize(this.videoElement, url, false);
|
|
25
32
|
player.on("streamInitialized", () => {
|
|
26
33
|
try {
|
|
@@ -72,4 +79,4 @@ class DashAdapter {
|
|
|
72
79
|
export {
|
|
73
80
|
DashAdapter
|
|
74
81
|
};
|
|
75
|
-
//# sourceMappingURL=dash-adapter-
|
|
82
|
+
//# sourceMappingURL=dash-adapter-BMpHWcBA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dash-adapter-BMpHWcBA.js","sources":["../src/streaming/dash-adapter.ts"],"sourcesContent":["import type { QualityLevel } from '@vizor-vr/shared';\nimport type { IStreamingAdapter, DrmContext } from './types.js';\n\n/**\n * DASH streaming adapter wrapping dashjs.\n * Lazy-loaded via dynamic import — only included in the bundle\n * when a DASH source is detected.\n */\nexport class DashAdapter implements IStreamingAdapter {\n private videoElement: HTMLVideoElement | null = null;\n private player: unknown | null = null;\n private _isAttached = false;\n private levels: QualityLevel[] = [];\n\n get supportsABR(): boolean {\n return true;\n }\n\n get isAttached(): boolean {\n return this._isAttached;\n }\n\n attach(videoElement: HTMLVideoElement): void {\n this.videoElement = videoElement;\n this._isAttached = true;\n }\n\n async load(url: string, drm?: DrmContext): Promise<void> {\n if (!this.videoElement) return;\n\n try {\n const dashjs = await import('dashjs');\n\n // Destroy previous instance\n if (this.player) {\n (this.player as { destroy(): void }).destroy();\n }\n\n const player = dashjs.MediaPlayer().create();\n\n if (drm) {\n const headers = drm.apiKey ? { 'x-api-key': drm.apiKey } : undefined;\n (player as unknown as { setProtectionData(d: unknown): void }).setProtectionData({\n 'com.widevine.alpha': { serverURL: drm.config.licenseUrls.widevine, httpRequestHeaders: headers },\n 'com.microsoft.playready': { serverURL: drm.config.licenseUrls.playready, httpRequestHeaders: headers },\n });\n }\n\n player.initialize(this.videoElement, url, false);\n\n // Extract quality levels once the stream info is available\n player.on('streamInitialized' as string, () => {\n try {\n const bitrateList = player.getBitrateInfoListFor('video');\n this.levels = bitrateList.map(\n (info: { height: number; width: number; bitrate: number }, i: number) => ({\n label: info.height ? `${info.height}p` : `Level ${i}`,\n width: info.width,\n height: info.height,\n bitrate: info.bitrate,\n active: false,\n }),\n );\n } catch {\n // Stream may not have video quality info\n }\n });\n\n this.player = player;\n } catch (e) {\n console.error('[Vizor] Failed to load dashjs:', e);\n }\n }\n\n getQualityLevels(): QualityLevel[] {\n return this.levels;\n }\n\n setQualityLevel(index: number): void {\n if (!this.player) return;\n const player = this.player as {\n setQualityFor(type: string, index: number): void;\n updateSettings(settings: unknown): void;\n };\n\n if (index === -1) {\n // Auto ABR\n player.updateSettings({\n streaming: { abr: { autoSwitchBitrate: { video: true } } },\n });\n } else {\n player.updateSettings({\n streaming: { abr: { autoSwitchBitrate: { video: false } } },\n });\n player.setQualityFor('video', index);\n }\n }\n\n destroy(): void {\n if (this.player) {\n (this.player as { destroy(): void }).destroy();\n }\n this.player = null;\n this.videoElement = null;\n this._isAttached = false;\n this.levels = [];\n }\n}\n"],"names":[],"mappings":"AAQO,MAAM,YAAyC;AAAA,EAC5C,eAAwC;AAAA,EACxC,SAAyB;AAAA,EACzB,cAAc;AAAA,EACd,SAAyB,CAAA;AAAA,EAEjC,IAAI,cAAuB;AACzB,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,aAAsB;AACxB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,OAAO,cAAsC;AAC3C,SAAK,eAAe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,EAAE,mBAAmB,EAAE,OAAO,OAAK,EAAE;AAAA,MAAE,CAC1D;AAAA,IACH,OAAO;AACL,aAAO,eAAe;AAAA,QACpB,WAAW,EAAE,KAAK,EAAE,mBAAmB,EAAE,OAAO,QAAM,EAAE;AAAA,MAAE,CAC3D;AACD,aAAO,cAAc,SAAS,KAAK;AAAA,IACrC;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,QAAI,KAAK,QAAQ;AACd,WAAK,OAA+B,QAAA;AAAA,IACvC;AACA,SAAK,SAAS;AACd,SAAK,eAAe;AACpB,SAAK,cAAc;AACnB,SAAK,SAAS,CAAA;AAAA,EAChB;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-client.test.d.ts","sourceRoot":"","sources":["../../../src/delivery/__tests__/delivery-client.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-hydrate.test.d.ts","sourceRoot":"","sources":["../../../src/delivery/__tests__/delivery-hydrate.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for the public content-delivery API (api-key gated).
|
|
3
|
+
*
|
|
4
|
+
* The player fetches a content item's config + authored overlays by content-id
|
|
5
|
+
* (reusing the same api-key path analytics uses) so an embed that only carries
|
|
6
|
+
* `content-id` + `api-key` can render authored annotations/captions without any
|
|
7
|
+
* DOM children. All fetchers are non-throwing: a failure returns null so the
|
|
8
|
+
* player degrades gracefully to whatever DOM the embed provided.
|
|
9
|
+
*/
|
|
10
|
+
import type { DeliveryContentConfig, DeliveryTourConfig, DeliveryAnnotation, AnnotationData } from '@vizor-vr/shared';
|
|
11
|
+
export interface ContentFetchOptions {
|
|
12
|
+
apiEndpoint: string;
|
|
13
|
+
contentId: string;
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TourFetchOptions {
|
|
17
|
+
apiEndpoint: string;
|
|
18
|
+
tourId: string;
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Fetch a content item's delivery config (player config + annotations + captions). */
|
|
22
|
+
export declare function fetchDeliveryContent(opts: ContentFetchOptions, fetchImpl?: typeof fetch): Promise<DeliveryContentConfig | null>;
|
|
23
|
+
/** Fetch a tour's delivery graph (probes + portals). */
|
|
24
|
+
export declare function fetchDeliveryTour(opts: TourFetchOptions, fetchImpl?: typeof fetch): Promise<DeliveryTourConfig | null>;
|
|
25
|
+
/** Map the delivery wire shape to the player's AnnotationData (null → undefined). */
|
|
26
|
+
export declare function deliveryAnnotationsToData(annotations: DeliveryAnnotation[]): AnnotationData[];
|
|
27
|
+
//# sourceMappingURL=delivery-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-client.d.ts","sourceRoot":"","sources":["../../src/delivery/delivery-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACf,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAsBD,uFAAuF;AACvF,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,mBAAmB,EACzB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAKvC;AAED,wDAAwD;AACxD,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,gBAAgB,EACtB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAKpC;AAED,qFAAqF;AACrF,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,kBAAkB,EAAE,GAAG,cAAc,EAAE,CAY7F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM hydration for content-id embeds.
|
|
3
|
+
*
|
|
4
|
+
* Given a fetched delivery config, inject the equivalent `<source>`,
|
|
5
|
+
* `<vz-annotation>` and `<track>` children into the host element BEFORE the
|
|
6
|
+
* media element's synchronous `onConnected()` runs, so the existing DOM-driven
|
|
7
|
+
* init (loadSources/initAnnotations/initCaptions) discovers them with no
|
|
8
|
+
* special-casing. A minimal `<vz-video content-id api-key>` thus renders the
|
|
9
|
+
* authored sources + overlays.
|
|
10
|
+
*/
|
|
11
|
+
import type { DeliveryContentConfig } from '@vizor-vr/shared';
|
|
12
|
+
/**
|
|
13
|
+
* Inject a fetched delivery config's sources + annotations + captions into the
|
|
14
|
+
* host element as DOM children. Idempotency/precedence is the caller's job
|
|
15
|
+
* (only hydrate when the author provided no DOM of their own).
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyDeliveryConfigToDom(host: HTMLElement, config: DeliveryContentConfig): void;
|
|
18
|
+
//# sourceMappingURL=delivery-hydrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-hydrate.d.ts","sourceRoot":"","sources":["../../src/delivery/delivery-hydrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAkE9D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAc/F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a DeliveryDrm from `drm-*` DOM attributes on a self-hosted embed
|
|
3
|
+
* (the DOM-attribute DRM path — an alternative to the delivery API). Requires
|
|
4
|
+
* a key id + all three license URLs; a partial set returns null (treated as
|
|
5
|
+
* non-DRM) rather than half-configuring the CDM.
|
|
6
|
+
*/
|
|
7
|
+
import type { DeliveryDrm } from '@vizor-vr/shared';
|
|
8
|
+
export declare function parseDomDrmConfig(host: HTMLElement): DeliveryDrm | null;
|
|
9
|
+
//# sourceMappingURL=dom-drm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-drm.d.ts","sourceRoot":"","sources":["../../src/delivery/dom-drm.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAavE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HTMLElementBase } from '../core/html-element.js';
|
|
2
|
+
import type { RawChapter } from '../chapters/chapter-logic.js';
|
|
3
|
+
/**
|
|
4
|
+
* <vz-chapter> — child of vz-video/vz-img declaring a manual chapter marker.
|
|
5
|
+
*
|
|
6
|
+
* A data-holder element with no shadow DOM (like <vz-annotation>). The parent
|
|
7
|
+
* media element reads these to build seek-bar markers + a chapter menu and to
|
|
8
|
+
* fire `vz-chapter-change`. Also emitted by delivery hydration for content-id
|
|
9
|
+
* embeds.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```html
|
|
13
|
+
* <vz-video format="MONO_360">
|
|
14
|
+
* <source src="tour.mp4" type="video/mp4" />
|
|
15
|
+
* <vz-chapter start="0" title="Lobby"></vz-chapter>
|
|
16
|
+
* <vz-chapter start="42.5" title="Main hall"></vz-chapter>
|
|
17
|
+
* </vz-video>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class VzChapterElement extends HTMLElementBase {
|
|
21
|
+
static get observedAttributes(): string[];
|
|
22
|
+
/** Parse this element's attributes into a RawChapter. */
|
|
23
|
+
getData(): RawChapter;
|
|
24
|
+
}
|
|
25
|
+
/** Register the <vz-chapter> custom element. */
|
|
26
|
+
export declare function registerChapter(): void;
|
|
27
|
+
//# sourceMappingURL=vz-chapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vz-chapter.d.ts","sourceRoot":"","sources":["../../src/elements/vz-chapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,yDAAyD;IACzD,OAAO,IAAI,UAAU;CActB;AAED,gDAAgD;AAChD,wBAAgB,eAAe,IAAI,IAAI,CAKtC"}
|
|
@@ -17,8 +17,28 @@ import { VzMediaElement } from '../core/media-element.js';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare class VzCinemaElement extends VzMediaElement {
|
|
19
19
|
private cinemaProjection;
|
|
20
|
+
private videoDataReady;
|
|
21
|
+
/** Guard so the projection (cinema or flat fallback) is only built once. */
|
|
22
|
+
private projectionSetup;
|
|
20
23
|
static get observedAttributes(): string[];
|
|
21
24
|
protected onMediaConnected(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Cinema is a paid feature. The base class runs its own gates (format, webxr,
|
|
27
|
+
* spatial audio) here; we add the cinema gate and (re)attempt projection
|
|
28
|
+
* setup now that the license is known.
|
|
29
|
+
*/
|
|
30
|
+
protected onLicenseResolved(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Build the projection once BOTH the video data is ready AND the license has
|
|
33
|
+
* resolved. Licensed → the cinema room projection. Unlicensed → graceful
|
|
34
|
+
* downgrade to flat (mono) playback of the same clip.
|
|
35
|
+
*/
|
|
36
|
+
private maybeSetupProjection;
|
|
37
|
+
/**
|
|
38
|
+
* Graceful downgrade when the tier lacks cinema: render the clip as an
|
|
39
|
+
* ordinary flat video instead of projecting it onto a screen inside a room.
|
|
40
|
+
*/
|
|
41
|
+
private setupFlatFallback;
|
|
22
42
|
protected onMediaDisconnected(): void;
|
|
23
43
|
private setupCinemaProjection;
|
|
24
44
|
private getNumAttr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vz-cinema.d.ts","sourceRoot":"","sources":["../../src/elements/vz-cinema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vz-cinema.d.ts","sourceRoot":"","sources":["../../src/elements/vz-cinema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IACjD,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,cAAc,CAAS;IAC/B,4EAA4E;IAC5E,OAAO,CAAC,eAAe,CAAS;IAEhC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAMxC;IAED,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAkBlC;;;;OAIG;cACgB,iBAAiB,IAAI,IAAI;IAK5C;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAc5B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAIzB,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAMrC,OAAO,CAAC,qBAAqB;IAiC7B,OAAO,CAAC,UAAU;CAMnB;AAED,8CAA8C;AAC9C,wBAAgB,cAAc,IAAI,IAAI,CAIrC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLElementBase } from '../core/html-element.js';
|
|
2
|
+
import type { RawHubItem } from '../hub/hub-model.js';
|
|
3
|
+
/**
|
|
4
|
+
* <vz-hub-item> — a content entry inside a <vz-hub> lobby. A data-holder element
|
|
5
|
+
* (no shadow DOM, like <vz-annotation>/<vz-chapter>). The parent <vz-hub> reads
|
|
6
|
+
* these to build clickable lobby panels; selecting one plays that source.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <vz-hub background="lobby.jpg">
|
|
11
|
+
* <vz-hub-item src="intro.mp4" poster="intro.jpg" title="Intro" format="MONO_360"></vz-hub-item>
|
|
12
|
+
* <vz-hub-item src="tour.mp4" poster="tour.jpg" title="Factory tour"></vz-hub-item>
|
|
13
|
+
* </vz-hub>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class VzHubItemElement extends HTMLElementBase {
|
|
17
|
+
static get observedAttributes(): string[];
|
|
18
|
+
/** Parse this element's attributes into a RawHubItem. */
|
|
19
|
+
getData(): RawHubItem;
|
|
20
|
+
}
|
|
21
|
+
/** Register the <vz-hub-item> custom element. */
|
|
22
|
+
export declare function registerHubItem(): void;
|
|
23
|
+
//# sourceMappingURL=vz-hub-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vz-hub-item.d.ts","sourceRoot":"","sources":["../../src/elements/vz-hub-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,yDAAyD;IACzD,OAAO,IAAI,UAAU;CAStB;AAED,iDAAiD;AACjD,wBAAgB,eAAe,IAAI,IAAI,CAKtC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { VzBaseElement } from '../core/base-element.js';
|
|
2
|
+
/**
|
|
3
|
+
* <vz-hub> — a spatial 360 "lobby" that organizes VR content into clickable
|
|
4
|
+
* poster panels. Selecting a panel plays that item in place (an inline
|
|
5
|
+
* vz-video/vz-img with a "back to lobby" control); returning restores the
|
|
6
|
+
* gallery. Enterprise-gated: without the license the lobby shows as a static
|
|
7
|
+
* panorama with an upgrade note (graceful downgrade).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```html
|
|
11
|
+
* <vz-hub background="lobby.jpg" style="width:100%; aspect-ratio:16/9">
|
|
12
|
+
* <vz-hub-item src="intro.mp4" poster="intro.jpg" title="Intro"></vz-hub-item>
|
|
13
|
+
* <vz-hub-item src="tour.mp4" poster="tour.jpg" title="Factory tour"></vz-hub-item>
|
|
14
|
+
* </vz-hub>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class VzHubElement extends VzBaseElement {
|
|
18
|
+
private renderer;
|
|
19
|
+
private containerEl;
|
|
20
|
+
private items;
|
|
21
|
+
private panelManager;
|
|
22
|
+
private controller;
|
|
23
|
+
private controlsOverlay;
|
|
24
|
+
private compass;
|
|
25
|
+
private fullscreenButton;
|
|
26
|
+
private vrButton;
|
|
27
|
+
private xrManager;
|
|
28
|
+
private cleanupFullscreen;
|
|
29
|
+
private loader;
|
|
30
|
+
private bgTexture;
|
|
31
|
+
private playingEl;
|
|
32
|
+
private hubLocked;
|
|
33
|
+
protected onConnected(): void;
|
|
34
|
+
protected onDisconnected(): void;
|
|
35
|
+
protected onAttributeChanged(): void;
|
|
36
|
+
protected onResize(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Hub is an Enterprise feature; WebXR is gated separately. On license resolve:
|
|
39
|
+
* - hub not licensed → lock to a static lobby panorama (panels removed, an
|
|
40
|
+
* upgrade note shown) — graceful downgrade, the background still renders.
|
|
41
|
+
* - webxr not licensed → remove the VR button.
|
|
42
|
+
*/
|
|
43
|
+
protected onLicenseResolved(): void;
|
|
44
|
+
toggleFullscreen(): void;
|
|
45
|
+
/** Show the lobby: background panorama + clickable panels (unless locked). */
|
|
46
|
+
private showLobby;
|
|
47
|
+
/** Play a selected item inline via a child vz-video/vz-img + a back control. */
|
|
48
|
+
private playItem;
|
|
49
|
+
/** Return to the lobby: tear down the inline player, re-render panels. */
|
|
50
|
+
private returnToLobby;
|
|
51
|
+
private showUpgradeOverlay;
|
|
52
|
+
/** Parse <vz-hub-item> children into a normalized item list. */
|
|
53
|
+
private parseItems;
|
|
54
|
+
}
|
|
55
|
+
/** Register the <vz-hub> custom element. */
|
|
56
|
+
export declare function registerHub(): void;
|
|
57
|
+
//# sourceMappingURL=vz-hub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vz-hub.d.ts","sourceRoot":"","sources":["../../src/elements/vz-hub.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAcxD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,YAAa,SAAQ,aAAa;IAC7C,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,SAAS,CAAS;IAE1B,SAAS,CAAC,WAAW,IAAI,IAAI;IAyD7B,SAAS,CAAC,cAAc,IAAI,IAAI;IAgBhC,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAIpC,SAAS,CAAC,QAAQ,IAAI,IAAI;IAI1B;;;;;OAKG;cACgB,iBAAiB,IAAI,IAAI;IAgB5C,gBAAgB,IAAI,IAAI;IAKxB,8EAA8E;IAC9E,OAAO,CAAC,SAAS;IAwBjB,gFAAgF;IAChF,OAAO,CAAC,QAAQ;IAyChB,0EAA0E;IAC1E,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,kBAAkB;IAW1B,gEAAgE;IAChE,OAAO,CAAC,UAAU;CAQnB;AAED,4CAA4C;AAC5C,wBAAgB,WAAW,IAAI,IAAI,CAKlC"}
|
|
@@ -37,6 +37,14 @@ export declare class VzPlaylistElement extends HTMLElementBase {
|
|
|
37
37
|
private playlistPanel;
|
|
38
38
|
private endedHandler;
|
|
39
39
|
private connected;
|
|
40
|
+
/**
|
|
41
|
+
* True once a child player reports a license tier without the `playlist`
|
|
42
|
+
* feature. The queue degrades to playing only the first item as a single
|
|
43
|
+
* clip: auto-advance and prev/next navigation are disabled and the multi-item
|
|
44
|
+
* controls/panel are removed.
|
|
45
|
+
*/
|
|
46
|
+
private playlistLocked;
|
|
47
|
+
private licenseListener;
|
|
40
48
|
constructor();
|
|
41
49
|
static get observedAttributes(): string[];
|
|
42
50
|
get autoplay(): boolean;
|
|
@@ -53,6 +61,12 @@ export declare class VzPlaylistElement extends HTMLElementBase {
|
|
|
53
61
|
next(): void;
|
|
54
62
|
/** Go to previous item */
|
|
55
63
|
previous(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Graceful downgrade when the tier lacks the playlist feature: keep the first
|
|
66
|
+
* item playing as a single clip and disable everything queue-specific —
|
|
67
|
+
* auto-advance, prev/next, the injected controls, and the side panel.
|
|
68
|
+
*/
|
|
69
|
+
private applyPlaylistLock;
|
|
56
70
|
/** Shuffle the playlist order */
|
|
57
71
|
shuffle(): void;
|
|
58
72
|
/** Get current item index */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vz-playlist.d.ts","sourceRoot":"","sources":["../../src/elements/vz-playlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"vz-playlist.d.ts","sourceRoot":"","sources":["../../src/elements/vz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AIG;IACH,OAAO,CAAC,iBAAiB;IAYzB,iCAAiC;IACjC,OAAO,IAAI,IAAI;IAqBf,6BAA6B;IAC7B,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED,2BAA2B;IAC3B,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,oCAAoC;IACpC,IAAI,aAAa,IAAI,WAAW,GAAG,IAAI,CAEtC;IAED,4CAA4C;IAC5C,WAAW,IAAI,IAAI;IAMnB,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,cAAc;IA6CtB,OAAO,CAAC,YAAY;CA2BrB;AAED,gDAAgD;AAChD,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC"}
|
|
@@ -28,10 +28,26 @@ export declare class VzTourElement extends VzBaseElement {
|
|
|
28
28
|
private xrManager;
|
|
29
29
|
private cleanupFullscreen;
|
|
30
30
|
private loader;
|
|
31
|
+
/**
|
|
32
|
+
* True once the license resolves without the `tours` feature. In that state
|
|
33
|
+
* the tour degrades to a single static panorama (the start probe): portal
|
|
34
|
+
* navigation between probes is disabled.
|
|
35
|
+
*/
|
|
36
|
+
private toursLocked;
|
|
31
37
|
protected onConnected(): void;
|
|
32
38
|
protected onDisconnected(): void;
|
|
33
39
|
protected onAttributeChanged(_name: string): void;
|
|
34
40
|
protected onResize(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Interactive tours are a paid feature, and WebXR (Enter-VR) is gated
|
|
43
|
+
* separately. Once the license resolves, enforce both.
|
|
44
|
+
*
|
|
45
|
+
* - tours not licensed → graceful downgrade to a single static panorama: the
|
|
46
|
+
* start probe stays visible but portal navigation is disabled (existing
|
|
47
|
+
* portals cleared, future ones suppressed).
|
|
48
|
+
* - webxr not licensed → remove the VR button (flat viewing continues).
|
|
49
|
+
*/
|
|
50
|
+
protected onLicenseResolved(): void;
|
|
35
51
|
/** Navigate to a specific probe by ID */
|
|
36
52
|
navigateTo(probeId: string): Promise<void>;
|
|
37
53
|
/** Get current probe ID */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vz-tour.d.ts","sourceRoot":"","sources":["../../src/elements/vz-tour.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"vz-tour.d.ts","sourceRoot":"","sources":["../../src/elements/vz-tour.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAYxD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAc,SAAQ,aAAa;IAC9C,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,MAAM,CAAuB;IACrC;;;;OAIG;IACH,OAAO,CAAC,WAAW,CAAS;IAE5B,SAAS,CAAC,WAAW,IAAI,IAAI;IAuE7B,SAAS,CAAC,cAAc,IAAI,IAAI;IAkBhC,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIjD,SAAS,CAAC,QAAQ,IAAI,IAAI;IAI1B;;;;;;;;OAQG;cACgB,iBAAiB,IAAI,IAAI;IAc5C,yCAAyC;IACnC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsDhD,2BAA2B;IAC3B,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,gBAAgB,IAAI,IAAI;IAQxB,2DAA2D;IAC3D,OAAO,CAAC,WAAW;IAcnB,+CAA+C;IAC/C,OAAO,CAAC,gBAAgB;IAkBxB,gEAAgE;IAChE,OAAO,CAAC,gBAAgB;CAczB;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,IAAI,IAAI,CAInC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
const FAIRPLAY_KEY_SYSTEM = "com.apple.fps";
|
|
2
|
+
async function setupFairPlay(video, drm, apiKey, deps = {
|
|
3
|
+
fetch: (...a) => fetch(...a),
|
|
4
|
+
requestMediaKeySystemAccess: (...a) => navigator.requestMediaKeySystemAccess(...a)
|
|
5
|
+
}) {
|
|
6
|
+
try {
|
|
7
|
+
const access = await deps.requestMediaKeySystemAccess(FAIRPLAY_KEY_SYSTEM, [
|
|
8
|
+
{
|
|
9
|
+
initDataTypes: ["skd", "cenc"],
|
|
10
|
+
videoCapabilities: [{ contentType: "application/vnd.apple.mpegurl", robustness: "" }],
|
|
11
|
+
distinctiveIdentifier: "not-allowed",
|
|
12
|
+
persistentState: "not-allowed"
|
|
13
|
+
}
|
|
14
|
+
]);
|
|
15
|
+
const mediaKeys = await access.createMediaKeys();
|
|
16
|
+
if (drm.fairplayCertUrl) {
|
|
17
|
+
const certRes = await deps.fetch(drm.fairplayCertUrl, { headers: apiKey ? { "x-api-key": apiKey } : {} });
|
|
18
|
+
const cert = new Uint8Array(await certRes.arrayBuffer());
|
|
19
|
+
await mediaKeys.setServerCertificate(cert);
|
|
20
|
+
}
|
|
21
|
+
await video.setMediaKeys(mediaKeys);
|
|
22
|
+
video.addEventListener("encrypted", (event) => {
|
|
23
|
+
const e = event;
|
|
24
|
+
const session = mediaKeys.createSession();
|
|
25
|
+
session.addEventListener("message", (msgEvent) => {
|
|
26
|
+
const m = msgEvent;
|
|
27
|
+
const spc = new Uint8Array(m.message);
|
|
28
|
+
void (async () => {
|
|
29
|
+
try {
|
|
30
|
+
const res = await deps.fetch(drm.licenseUrls.fairplay, {
|
|
31
|
+
method: "POST",
|
|
32
|
+
headers: { "content-type": "application/octet-stream", ...apiKey ? { "x-api-key": apiKey } : {} },
|
|
33
|
+
body: buildSpcBody(spc)
|
|
34
|
+
});
|
|
35
|
+
const ckc = new Uint8Array(await res.arrayBuffer());
|
|
36
|
+
await session.update(parseCkc(ckc));
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.error("[Vizor] FairPlay license error:", err);
|
|
39
|
+
}
|
|
40
|
+
})();
|
|
41
|
+
});
|
|
42
|
+
void session.generateRequest(e.initDataType, e.initData);
|
|
43
|
+
});
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error("[Vizor] FairPlay setup failed:", err);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function buildSpcBody(spc) {
|
|
49
|
+
return spc;
|
|
50
|
+
}
|
|
51
|
+
function parseCkc(ckc) {
|
|
52
|
+
return ckc;
|
|
53
|
+
}
|
|
54
|
+
class HlsAdapter {
|
|
55
|
+
videoElement = null;
|
|
56
|
+
hls = null;
|
|
57
|
+
_isAttached = false;
|
|
58
|
+
_isNative = false;
|
|
59
|
+
levels = [];
|
|
60
|
+
/** Enable low-latency mode for live streams */
|
|
61
|
+
lowLatencyMode = false;
|
|
62
|
+
get supportsABR() {
|
|
63
|
+
return !this._isNative;
|
|
64
|
+
}
|
|
65
|
+
get isAttached() {
|
|
66
|
+
return this._isAttached;
|
|
67
|
+
}
|
|
68
|
+
attach(videoElement) {
|
|
69
|
+
this.videoElement = videoElement;
|
|
70
|
+
this._isAttached = true;
|
|
71
|
+
}
|
|
72
|
+
async load(url, drm) {
|
|
73
|
+
if (!this.videoElement) return;
|
|
74
|
+
if (this.videoElement.canPlayType("application/vnd.apple.mpegurl")) {
|
|
75
|
+
this.videoElement.src = url;
|
|
76
|
+
this._isNative = true;
|
|
77
|
+
if (drm) void setupFairPlay(this.videoElement, drm.config, drm.apiKey);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const HlsModule = await import("hls.js");
|
|
82
|
+
const Hls = HlsModule.default;
|
|
83
|
+
if (!Hls.isSupported()) {
|
|
84
|
+
console.error("[Vizor] HLS.js is not supported in this browser");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (this.hls) {
|
|
88
|
+
this.hls.destroy();
|
|
89
|
+
}
|
|
90
|
+
const hls = new Hls({
|
|
91
|
+
enableWorker: true,
|
|
92
|
+
lowLatencyMode: this.lowLatencyMode,
|
|
93
|
+
...this.lowLatencyMode ? { liveSyncDurationCount: 3, liveMaxLatencyDurationCount: 6 } : {},
|
|
94
|
+
...drm ? {
|
|
95
|
+
emeEnabled: true,
|
|
96
|
+
drmSystems: {
|
|
97
|
+
"com.widevine.alpha": { licenseUrl: drm.config.licenseUrls.widevine },
|
|
98
|
+
"com.microsoft.playready": { licenseUrl: drm.config.licenseUrls.playready }
|
|
99
|
+
},
|
|
100
|
+
licenseXhrSetup: (xhr, _url) => {
|
|
101
|
+
if (drm.apiKey) xhr.setRequestHeader("x-api-key", drm.apiKey);
|
|
102
|
+
}
|
|
103
|
+
} : {}
|
|
104
|
+
});
|
|
105
|
+
hls.attachMedia(this.videoElement);
|
|
106
|
+
hls.loadSource(url);
|
|
107
|
+
hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
|
108
|
+
this.levels = hls.levels.map(
|
|
109
|
+
(level, i) => ({
|
|
110
|
+
label: level.height ? `${level.height}p` : `Level ${i}`,
|
|
111
|
+
width: level.width,
|
|
112
|
+
height: level.height,
|
|
113
|
+
bitrate: level.bitrate,
|
|
114
|
+
active: i === hls.currentLevel
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
hls.on(Hls.Events.ERROR, (_event, data) => {
|
|
119
|
+
if (data.fatal) {
|
|
120
|
+
console.error("[Vizor] Fatal HLS error:", data.type, data.details);
|
|
121
|
+
switch (data.type) {
|
|
122
|
+
case Hls.ErrorTypes.NETWORK_ERROR:
|
|
123
|
+
hls.startLoad();
|
|
124
|
+
break;
|
|
125
|
+
case Hls.ErrorTypes.MEDIA_ERROR:
|
|
126
|
+
hls.recoverMediaError();
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
this.destroy();
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
this.hls = hls;
|
|
135
|
+
} catch (e) {
|
|
136
|
+
console.error("[Vizor] Failed to load hls.js:", e);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
getQualityLevels() {
|
|
140
|
+
return this.levels;
|
|
141
|
+
}
|
|
142
|
+
setQualityLevel(index) {
|
|
143
|
+
if (!this.hls || this._isNative) return;
|
|
144
|
+
const hls = this.hls;
|
|
145
|
+
hls.currentLevel = index;
|
|
146
|
+
}
|
|
147
|
+
destroy() {
|
|
148
|
+
if (this.hls && !this._isNative) {
|
|
149
|
+
this.hls.destroy();
|
|
150
|
+
}
|
|
151
|
+
this.hls = null;
|
|
152
|
+
this.videoElement = null;
|
|
153
|
+
this._isAttached = false;
|
|
154
|
+
this._isNative = false;
|
|
155
|
+
this.levels = [];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export {
|
|
159
|
+
HlsAdapter
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=hls-adapter-C_a65zia.js.map
|