@viostream/viostream-player-vue 0.2.7 → 0.2.8

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
@@ -91,6 +91,7 @@ All embed options are optional and passed directly to the Viostream embed API.
91
91
  | `start-time` | `string` | Seek to a time (seconds) before playback. |
92
92
  | `transcript-download` | `boolean` | Allow transcript download. Default: `false`. |
93
93
  | `use-settings-menu` | `boolean` | Enable the settings menu on the control bar. Default: `false`. |
94
+ | `force-aspect-ratio` | `number` | Force a specific aspect ratio (e.g. `1.7778` for 16:9). Disables dynamic sizing. Must be a finite positive number; invalid values are ignored. |
94
95
 
95
96
  #### Events
96
97
 
@@ -292,25 +293,6 @@ After calling `destroy()`:
292
293
  - Getter calls will reject with `"Player has been destroyed"`.
293
294
  ---
294
295
 
295
- ## Script Loader
296
-
297
- The SDK loads the Viostream API script automatically. If you need manual control over loading (e.g. preloading), you can use `loadViostream` directly:
298
-
299
- ```ts
300
- import { loadViostream } from '@viostream/viostream-player-vue';
301
-
302
- const api = await loadViostream('vc-100100100');
303
- // api.embed(...) is now available
304
- ```
305
-
306
- The loader:
307
- - Injects `<script src="https://play.viostream.com/api/{accountKey}">` into `<head>`.
308
- - Deduplicates requests -- calling it multiple times with the same key returns the same promise.
309
- - Times out after 15 seconds if the script fails to load.
310
- - Detects if the script tag already exists in the DOM (e.g. added manually) and waits for it.
311
-
312
- ---
313
-
314
296
  ## TypeScript
315
297
 
316
298
  Every export is fully typed. Import types alongside runtime exports:
@@ -18,6 +18,7 @@ type __VLS_Props = {
18
18
  startTime?: string;
19
19
  transcriptDownload?: boolean;
20
20
  useSettingsMenu?: boolean;
21
+ forceAspectRatio?: number;
21
22
  class?: string;
22
23
  };
23
24
  declare function __VLS_template(): {
@@ -80,6 +81,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
80
81
  startTime: string;
81
82
  transcriptDownload: boolean;
82
83
  useSettingsMenu: boolean;
84
+ forceAspectRatio: number;
83
85
  class: string;
84
86
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
85
87
  containerRef: HTMLDivElement;
@@ -1 +1 @@
1
- {"version":3,"file":"ViostreamPlayer.vue.d.ts","sourceRoot":"","sources":["../src/ViostreamPlayer.vue"],"names":[],"mappings":"AAMA;AA0RA,OAAO,KAAK,EAEV,eAAe,EAGf,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,WAAW,GAAG;IAEjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAGlB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,cAAc,CAAC;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAiOF,iBAAS,cAAc;WAwCT,OAAO,IAA6B;;kBA5NtC,MAAM,OAAO;gBACf,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO;;kBADrC,MAAM,OAAO;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,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { defineComponent as O, ref as S, onMounted as V, onUnmounted as j, openBlock as U, createElementBlock as x, unref as M, normalizeClass as L, renderSlot as B, createCommentVNode as T, createElementVNode as q, toDisplayString as z } from "vue";
2
- import { getViostreamApi as Q, wrapRawPlayer as J } from "@viostream/viostream-player-core";
3
- import { createViostreamPlayer as le, loadViostream as ce } from "@viostream/viostream-player-core";
4
- function G(c) {
1
+ import { defineComponent as O, ref as S, onMounted as V, onUnmounted as j, openBlock as U, createElementBlock as x, unref as M, normalizeClass as L, renderSlot as B, createCommentVNode as R, createElementVNode as q, toDisplayString as z } from "vue";
2
+ import { getViostreamApi as Q, normalizeForceAspectRatio as J, wrapRawPlayer as G } from "@viostream/viostream-player-core";
3
+ import { createViostreamPlayer as ce, loadViostream as ue } from "@viostream/viostream-player-core";
4
+ function W(c) {
5
5
  return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
6
6
  }
7
- var K = { exports: {} }, E, _;
8
- function W() {
9
- if (_) return E;
10
- _ = 1;
7
+ var K = { exports: {} }, E, T;
8
+ function Z() {
9
+ if (T) return E;
10
+ T = 1;
11
11
  var c = 1e3, l = c * 60, i = l * 60, e = i * 24, d = e * 7, m = e * 365.25;
12
12
  E = function(o, t) {
13
13
  t = t || {};
@@ -86,12 +86,12 @@ function W() {
86
86
  }
87
87
  return E;
88
88
  }
89
- var A, P;
90
- function Z() {
91
- if (P) return A;
92
- P = 1;
89
+ var A, _;
90
+ function H() {
91
+ if (_) return A;
92
+ _ = 1;
93
93
  function c(l) {
94
- e.debug = e, e.default = e, e.coerce = f, e.disable = v, e.enable = m, e.enabled = s, e.humanize = W(), e.destroy = o, Object.keys(l).forEach((t) => {
94
+ e.debug = e, e.default = e, e.coerce = f, e.disable = v, e.enable = m, e.enabled = s, e.humanize = Z(), e.destroy = o, Object.keys(l).forEach((t) => {
95
95
  e[t] = l[t];
96
96
  }), e.names = [], e.skips = [], e.formatters = {};
97
97
  function i(t) {
@@ -109,11 +109,11 @@ function Z() {
109
109
  const r = p, C = Number(/* @__PURE__ */ new Date()), F = C - (n || C);
110
110
  r.diff = F, r.prev = n, r.curr = C, n = C, y[0] = e.coerce(y[0]), typeof y[0] != "string" && y.unshift("%O");
111
111
  let g = 0;
112
- y[0] = y[0].replace(/%([a-zA-Z%])/g, (w, R) => {
112
+ y[0] = y[0].replace(/%([a-zA-Z%])/g, (w, D) => {
113
113
  if (w === "%%")
114
114
  return "%";
115
115
  g++;
116
- const I = e.formatters[R];
116
+ const I = e.formatters[D];
117
117
  if (typeof I == "function") {
118
118
  const N = y[g];
119
119
  w = I.call(r, N), y.splice(g, 1), g--;
@@ -179,9 +179,9 @@ function Z() {
179
179
  }
180
180
  return A = c, A;
181
181
  }
182
- var D;
183
- function H() {
184
- return D || (D = 1, (function(c, l) {
182
+ var P;
183
+ function X() {
184
+ return P || (P = 1, (function(c, l) {
185
185
  l.formatArgs = e, l.save = d, l.load = m, l.useColors = i, l.storage = h(), l.destroy = /* @__PURE__ */ (() => {
186
186
  let s = !1;
187
187
  return () => {
@@ -309,7 +309,7 @@ function H() {
309
309
  } catch {
310
310
  }
311
311
  }
312
- c.exports = Z()(l);
312
+ c.exports = H()(l);
313
313
  const { formatters: v } = c.exports;
314
314
  v.j = function(s) {
315
315
  try {
@@ -320,11 +320,11 @@ function H() {
320
320
  };
321
321
  })(K, K.exports)), K.exports;
322
322
  }
323
- var X = H();
324
- const Y = /* @__PURE__ */ G(X), $ = "viostream-player-vue", ee = "0.2.7", te = ["data-viostream-public-key", "data-viostream-sdk"], re = {
323
+ var Y = X();
324
+ const $ = /* @__PURE__ */ W(Y), ee = "viostream-player-vue", te = "0.2.8", re = ["data-viostream-public-key", "data-viostream-sdk"], ne = {
325
325
  "data-viostream-error": "",
326
326
  style: { color: "red", padding: "1em" }
327
- }, se = /* @__PURE__ */ O({
327
+ }, ie = /* @__PURE__ */ O({
328
328
  __name: "ViostreamPlayer",
329
329
  props: {
330
330
  accountKey: {},
@@ -345,11 +345,12 @@ const Y = /* @__PURE__ */ G(X), $ = "viostream-player-vue", ee = "0.2.7", te = [
345
345
  startTime: { default: void 0 },
346
346
  transcriptDownload: { type: Boolean, default: void 0 },
347
347
  useSettingsMenu: { type: Boolean, default: void 0 },
348
+ forceAspectRatio: { default: void 0 },
348
349
  class: { default: void 0 }
349
350
  },
350
351
  emits: ["play", "pause", "ended", "timeUpdate", "volumeChange", "error", "progress", "ready", "seeked", "loaded", "playerReady"],
351
352
  setup(c, { emit: l }) {
352
- const i = Y("viostream:vue"), e = c, d = l, m = `viostream-player-${Math.random().toString(36).slice(2, 10)}`, h = S(), v = S(), s = S(), f = S(!0);
353
+ const i = $("viostream:vue"), e = c, d = l, m = `viostream-player-${Math.random().toString(36).slice(2, 10)}`, h = S(), v = S(), s = S(), f = S(!0);
353
354
  let o = !1;
354
355
  const t = [];
355
356
  i("component setup publicKey=%s containerId=%s", e.publicKey, m);
@@ -407,9 +408,9 @@ const Y = /* @__PURE__ */ G(X), $ = "viostream-player-vue", ee = "0.2.7", te = [
407
408
  }
408
409
  const C = n();
409
410
  i("init: calling api.embed publicKey=%s containerId=%s options=%o", e.publicKey, m, C);
410
- const F = r.embed(e.publicKey, m, C);
411
+ const F = r.embed(e.publicKey, m, C, J(e.forceAspectRatio));
411
412
  i("init: api.embed returned raw player");
412
- const g = J(F, m);
413
+ const g = G(F, m);
413
414
  if (i("init: wrapRawPlayer completed containerId=%s", m), o) {
414
415
  i("init: stale closure detected after wrapRawPlayer — destroying and aborting publicKey=%s", e.publicKey), g.destroy();
415
416
  return;
@@ -436,20 +437,20 @@ const Y = /* @__PURE__ */ G(X), $ = "viostream-player-vue", ee = "0.2.7", te = [
436
437
  ref: h,
437
438
  "data-viostream-player": "",
438
439
  "data-viostream-public-key": c.publicKey,
439
- "data-viostream-sdk": `${M($)}@${M(ee)}`
440
+ "data-viostream-sdk": `${M(ee)}@${M(te)}`
440
441
  }, [
441
- f.value ? B(r.$slots, "loading", { key: 0 }) : T("", !0),
442
+ f.value ? B(r.$slots, "loading", { key: 0 }) : R("", !0),
442
443
  s.value ? B(r.$slots, "error", {
443
444
  key: 1,
444
445
  message: s.value
445
446
  }, () => [
446
- q("div", re, " Failed to load Viostream player: " + z(s.value), 1)
447
- ]) : T("", !0)
448
- ], 10, te));
447
+ q("div", ne, " Failed to load Viostream player: " + z(s.value), 1)
448
+ ]) : R("", !0)
449
+ ], 10, re));
449
450
  }
450
451
  });
451
452
  export {
452
- se as ViostreamPlayer,
453
- le as createViostreamPlayer,
454
- ce as loadViostream
453
+ ie as ViostreamPlayer,
454
+ ce as createViostreamPlayer,
455
+ ue as loadViostream
455
456
  };
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const SDK_NAME = "viostream-player-vue";
2
- export declare const SDK_VERSION = "0.2.7";
2
+ export declare const SDK_VERSION = "0.2.8";
3
3
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viostream/viostream-player-vue",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Vue 3 SDK for the Viostream video player — embed, control, and listen to player events",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -29,7 +29,7 @@
29
29
  "!dist/**/*.spec.*"
30
30
  ],
31
31
  "dependencies": {
32
- "@viostream/viostream-player-core": "^0.2.7",
32
+ "@viostream/viostream-player-core": "^0.2.8",
33
33
  "debug": "^4.4.3"
34
34
  },
35
35
  "peerDependencies": {