@vizor-vr/vue 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 CHANGED
@@ -26,6 +26,10 @@ The wrappers import and register the underlying custom elements for you. They ar
26
26
 
27
27
  `VzVideo`, `VzImg`, `VzTour`, `VzCinema`, `VzLive`, `VzPlaylist`, `VzAnnotation`, `VzCaption`.
28
28
 
29
+ ## Security
30
+
31
+ See the monorepo [security policy](https://github.com/vizor-vr/vizor-vr/blob/main/SECURITY.md) for how to report vulnerabilities (security@utgnetworks.com).
32
+
29
33
  ## License
30
34
 
31
35
  MIT — see [LICENSE](./LICENSE).
@@ -59,6 +59,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
59
59
  readonly type: StringConstructor;
60
60
  readonly default: undefined;
61
61
  };
62
+ readonly lensAngle: {
63
+ readonly type: NumberConstructor;
64
+ readonly default: undefined;
65
+ };
62
66
  readonly collabServer: {
63
67
  readonly type: StringConstructor;
64
68
  readonly default: undefined;
@@ -146,6 +150,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
146
150
  readonly type: StringConstructor;
147
151
  readonly default: undefined;
148
152
  };
153
+ readonly lensAngle: {
154
+ readonly type: NumberConstructor;
155
+ readonly default: undefined;
156
+ };
149
157
  readonly collabServer: {
150
158
  readonly type: StringConstructor;
151
159
  readonly default: undefined;
@@ -185,6 +193,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
185
193
  readonly controlsBehavior: "autohide" | "always" | "minimal";
186
194
  readonly hideControls: boolean;
187
195
  readonly primaryColor: string;
196
+ readonly lensAngle: number;
188
197
  readonly collabServer: string;
189
198
  readonly collabRoom: string;
190
199
  readonly collabRole: "host" | "viewer";
@@ -1 +1 @@
1
- {"version":3,"file":"VzCinema.vue.d.ts","sourceRoot":"","sources":["../src/VzCinema.vue"],"names":[],"mappings":"AAgIA,QAAA,IAAuB,OAAO,IAAW,CAA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KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -59,6 +59,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
59
59
  readonly type: StringConstructor;
60
60
  readonly default: undefined;
61
61
  };
62
+ readonly lensAngle: {
63
+ readonly type: NumberConstructor;
64
+ readonly default: undefined;
65
+ };
62
66
  readonly collabServer: {
63
67
  readonly type: StringConstructor;
64
68
  readonly default: undefined;
@@ -147,6 +151,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
147
151
  readonly type: StringConstructor;
148
152
  readonly default: undefined;
149
153
  };
154
+ readonly lensAngle: {
155
+ readonly type: NumberConstructor;
156
+ readonly default: undefined;
157
+ };
150
158
  readonly collabServer: {
151
159
  readonly type: StringConstructor;
152
160
  readonly default: undefined;
@@ -186,6 +194,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
186
194
  readonly controlsBehavior: "autohide" | "always" | "minimal";
187
195
  readonly hideControls: boolean;
188
196
  readonly primaryColor: string;
197
+ readonly lensAngle: number;
189
198
  readonly collabServer: string;
190
199
  readonly collabRoom: string;
191
200
  readonly collabRole: "host" | "viewer";
@@ -1 +1 @@
1
- {"version":3,"file":"VzLive.vue.d.ts","sourceRoot":"","sources":["../src/VzLive.vue"],"names":[],"mappings":"AAkIA,QAAA,IAAuB,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAjGnB,2CAA2C;;;;IAI3C,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAqGxB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"VzLive.vue.d.ts","sourceRoot":"","sources":["../src/VzLive.vue"],"names":[],"mappings":"AAkIA,QAAA,IAAuB,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAjGnB,2CAA2C;;;;IAI3C,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAqGxB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -59,6 +59,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
59
59
  readonly type: StringConstructor;
60
60
  readonly default: undefined;
61
61
  };
62
+ readonly lensAngle: {
63
+ readonly type: NumberConstructor;
64
+ readonly default: undefined;
65
+ };
62
66
  readonly collabServer: {
63
67
  readonly type: StringConstructor;
64
68
  readonly default: undefined;
@@ -149,6 +153,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
149
153
  readonly type: StringConstructor;
150
154
  readonly default: undefined;
151
155
  };
156
+ readonly lensAngle: {
157
+ readonly type: NumberConstructor;
158
+ readonly default: undefined;
159
+ };
152
160
  readonly collabServer: {
153
161
  readonly type: StringConstructor;
154
162
  readonly default: undefined;
@@ -188,6 +196,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
188
196
  readonly controlsBehavior: "autohide" | "always" | "minimal";
189
197
  readonly hideControls: boolean;
190
198
  readonly primaryColor: string;
199
+ readonly lensAngle: number;
191
200
  readonly collabServer: string;
192
201
  readonly collabRoom: string;
193
202
  readonly collabRole: "host" | "viewer";
@@ -1 +1 @@
1
- {"version":3,"file":"VzVideo.vue.d.ts","sourceRoot":"","sources":["../src/VzVideo.vue"],"names":[],"mappings":"AAsIA,QAAA,IAAuB,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAnGnB,4CAA4C;;IAE5C,4CAA4C;;IAE5C,6CAA6C;;IAE7C,8BAA8B;iBACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAoGnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"VzVideo.vue.d.ts","sourceRoot":"","sources":["../src/VzVideo.vue"],"names":[],"mappings":"AAyIA,QAAA,IAAuB,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IArGnB,4CAA4C;;IAE5C,4CAA4C;;IAE5C,6CAA6C;;IAE7C,8BAA8B;iBACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAsGnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,70 @@
1
+ var d = Object.defineProperty;
2
+ var n = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var r = (i, e, t) => n(i, typeof e != "symbol" ? e + "" : e, t);
4
+ class p {
5
+ constructor() {
6
+ r(this, "videoElement", null);
7
+ r(this, "player", null);
8
+ r(this, "_isAttached", !1);
9
+ r(this, "levels", []);
10
+ }
11
+ get supportsABR() {
12
+ return !0;
13
+ }
14
+ get isAttached() {
15
+ return this._isAttached;
16
+ }
17
+ attach(e) {
18
+ this.videoElement = e, this._isAttached = !0;
19
+ }
20
+ async load(e, t) {
21
+ if (this.videoElement)
22
+ try {
23
+ const h = await import("./dash.all.min-DJEXrg26.js").then((a) => a.d);
24
+ this.player && this.player.destroy();
25
+ const s = h.MediaPlayer().create();
26
+ if (t) {
27
+ const a = t.apiKey ? { "x-api-key": t.apiKey } : void 0;
28
+ s.setProtectionData({
29
+ "com.widevine.alpha": { serverURL: t.config.licenseUrls.widevine, httpRequestHeaders: a },
30
+ "com.microsoft.playready": { serverURL: t.config.licenseUrls.playready, httpRequestHeaders: a }
31
+ });
32
+ }
33
+ s.initialize(this.videoElement, e, !1), s.on("streamInitialized", () => {
34
+ try {
35
+ const a = s.getBitrateInfoListFor("video");
36
+ this.levels = a.map(
37
+ (l, o) => ({
38
+ label: l.height ? `${l.height}p` : `Level ${o}`,
39
+ width: l.width,
40
+ height: l.height,
41
+ bitrate: l.bitrate,
42
+ active: !1
43
+ })
44
+ );
45
+ } catch {
46
+ }
47
+ }), this.player = s;
48
+ } catch (h) {
49
+ console.error("[Vizor] Failed to load dashjs:", h);
50
+ }
51
+ }
52
+ getQualityLevels() {
53
+ return this.levels;
54
+ }
55
+ setQualityLevel(e) {
56
+ if (!this.player) return;
57
+ const t = this.player;
58
+ e === -1 ? t.updateSettings({
59
+ streaming: { abr: { autoSwitchBitrate: { video: !0 } } }
60
+ }) : (t.updateSettings({
61
+ streaming: { abr: { autoSwitchBitrate: { video: !1 } } }
62
+ }), t.setQualityFor("video", e));
63
+ }
64
+ destroy() {
65
+ this.player && this.player.destroy(), this.player = null, this.videoElement = null, this._isAttached = !1, this.levels = [];
66
+ }
67
+ }
68
+ export {
69
+ p as DashAdapter
70
+ };
@@ -0,0 +1,134 @@
1
+ var f = Object.defineProperty;
2
+ var v = (n, t, e) => t in n ? f(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var o = (n, t, e) => v(n, typeof t != "symbol" ? t + "" : t, e);
4
+ const w = "com.apple.fps";
5
+ async function E(n, t, e, l = {
6
+ fetch: (...s) => fetch(...s),
7
+ requestMediaKeySystemAccess: (...s) => navigator.requestMediaKeySystemAccess(...s)
8
+ }) {
9
+ try {
10
+ const i = await (await l.requestMediaKeySystemAccess(w, [
11
+ {
12
+ initDataTypes: ["skd", "cenc"],
13
+ videoCapabilities: [{ contentType: "application/vnd.apple.mpegurl", robustness: "" }],
14
+ distinctiveIdentifier: "not-allowed",
15
+ persistentState: "not-allowed"
16
+ }
17
+ ])).createMediaKeys();
18
+ if (t.fairplayCertUrl) {
19
+ const r = await l.fetch(t.fairplayCertUrl, { headers: e ? { "x-api-key": e } : {} }), a = new Uint8Array(await r.arrayBuffer());
20
+ await i.setServerCertificate(a);
21
+ }
22
+ await n.setMediaKeys(i), n.addEventListener("encrypted", (r) => {
23
+ const a = r, c = i.createSession();
24
+ c.addEventListener("message", (d) => {
25
+ const y = d, p = new Uint8Array(y.message);
26
+ (async () => {
27
+ try {
28
+ const h = await l.fetch(t.licenseUrls.fairplay, {
29
+ method: "POST",
30
+ headers: { "content-type": "application/octet-stream", ...e ? { "x-api-key": e } : {} },
31
+ body: p
32
+ }), u = new Uint8Array(await h.arrayBuffer());
33
+ await c.update(u);
34
+ } catch (h) {
35
+ console.error("[Vizor] FairPlay license error:", h);
36
+ }
37
+ })();
38
+ }), c.generateRequest(a.initDataType, a.initData);
39
+ });
40
+ } catch (s) {
41
+ console.error("[Vizor] FairPlay setup failed:", s);
42
+ }
43
+ }
44
+ class S {
45
+ constructor() {
46
+ o(this, "videoElement", null);
47
+ o(this, "hls", null);
48
+ o(this, "_isAttached", !1);
49
+ o(this, "_isNative", !1);
50
+ o(this, "levels", []);
51
+ /** Enable low-latency mode for live streams */
52
+ o(this, "lowLatencyMode", !1);
53
+ }
54
+ get supportsABR() {
55
+ return !this._isNative;
56
+ }
57
+ get isAttached() {
58
+ return this._isAttached;
59
+ }
60
+ attach(t) {
61
+ this.videoElement = t, this._isAttached = !0;
62
+ }
63
+ async load(t, e) {
64
+ if (this.videoElement) {
65
+ if (this.videoElement.canPlayType("application/vnd.apple.mpegurl")) {
66
+ this.videoElement.src = t, this._isNative = !0, e && E(this.videoElement, e.config, e.apiKey);
67
+ return;
68
+ }
69
+ try {
70
+ const s = (await import("./hls-CxmYC9fy.js")).default;
71
+ if (!s.isSupported()) {
72
+ console.error("[Vizor] HLS.js is not supported in this browser");
73
+ return;
74
+ }
75
+ this.hls && this.hls.destroy();
76
+ const i = new s({
77
+ enableWorker: !0,
78
+ lowLatencyMode: this.lowLatencyMode,
79
+ ...this.lowLatencyMode ? { liveSyncDurationCount: 3, liveMaxLatencyDurationCount: 6 } : {},
80
+ ...e ? {
81
+ emeEnabled: !0,
82
+ drmSystems: {
83
+ "com.widevine.alpha": { licenseUrl: e.config.licenseUrls.widevine },
84
+ "com.microsoft.playready": { licenseUrl: e.config.licenseUrls.playready }
85
+ },
86
+ licenseXhrSetup: (r, a) => {
87
+ e.apiKey && r.setRequestHeader("x-api-key", e.apiKey);
88
+ }
89
+ } : {}
90
+ });
91
+ i.attachMedia(this.videoElement), i.loadSource(t), i.on(s.Events.MANIFEST_PARSED, () => {
92
+ this.levels = i.levels.map(
93
+ (r, a) => ({
94
+ label: r.height ? `${r.height}p` : `Level ${a}`,
95
+ width: r.width,
96
+ height: r.height,
97
+ bitrate: r.bitrate,
98
+ active: a === i.currentLevel
99
+ })
100
+ );
101
+ }), i.on(s.Events.ERROR, (r, a) => {
102
+ if (a.fatal)
103
+ switch (console.error("[Vizor] Fatal HLS error:", a.type, a.details), a.type) {
104
+ case s.ErrorTypes.NETWORK_ERROR:
105
+ i.startLoad();
106
+ break;
107
+ case s.ErrorTypes.MEDIA_ERROR:
108
+ i.recoverMediaError();
109
+ break;
110
+ default:
111
+ this.destroy();
112
+ break;
113
+ }
114
+ }), this.hls = i;
115
+ } catch (l) {
116
+ console.error("[Vizor] Failed to load hls.js:", l);
117
+ }
118
+ }
119
+ }
120
+ getQualityLevels() {
121
+ return this.levels;
122
+ }
123
+ setQualityLevel(t) {
124
+ if (!this.hls || this._isNative) return;
125
+ const e = this.hls;
126
+ e.currentLevel = t;
127
+ }
128
+ destroy() {
129
+ this.hls && !this._isNative && this.hls.destroy(), this.hls = null, this.videoElement = null, this._isAttached = !1, this._isNative = !1, this.levels = [];
130
+ }
131
+ }
132
+ export {
133
+ S as HlsAdapter
134
+ };