xvai-loi 0.1.88 → 0.1.90

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.
Files changed (3) hide show
  1. package/co.txt +1 -1
  2. package/package.json +1 -1
  3. package/xvai-loi.js +12 -5
package/co.txt CHANGED
@@ -1 +1 @@
1
- xvaiLoi120538
1
+ xvaiLoi120612
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xvai-loi",
3
- "version": "0.1.88",
3
+ "version": "0.1.90",
4
4
  "description": "Loi dung video (Edit Video Tu Dong) nap vao tool Google Flow qua o cam engine/oCam.ts",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/xvai-loi.js CHANGED
@@ -10536,7 +10536,7 @@ function docDemo(g, d, tuoi, W4, hT) {
10536
10536
  g.restore();
10537
10537
  }
10538
10538
  function taiLieu(g, ds2, tuoi, W4, H2, a) {
10539
- const x = 0.12 * W4, y = 0.16 * H2, w = 0.76 * W4, dh = 0.034 * H2, h = 0.06 * H2 + ds2.length * dh + 0.02 * H2, k = eSoft(tuoi / 0.3);
10539
+ const n = Math.max(1, ds2.length), dh = Math.min(0.06 * H2, Math.max(0.034 * H2, 0.22 * H2 / n)), h = 0.06 * H2 + n * dh + 0.02 * H2, x = 0.12 * W4, y = 0.16 * H2 + Math.max(0, (0.3 * H2 - h) / 2), w = 0.76 * W4, k = eSoft(tuoi / 0.3);
10540
10540
  g.save();
10541
10541
  g.globalAlpha = a;
10542
10542
  g.translate(W4 / 2, y + h / 2);
@@ -10554,14 +10554,14 @@ function taiLieu(g, ds2, tuoi, W4, H2, a) {
10554
10554
  g.fillStyle = CAM;
10555
10555
  g.fillRect(x, y, w, 0.05 * H2);
10556
10556
  g.restore();
10557
- g.font = "900 " + (0.022 * H2).toFixed(1) + "px " + FB;
10557
+ g.font = "900 " + (0.026 * H2).toFixed(1) + "px " + FB;
10558
10558
  g.fillStyle = "#fff";
10559
10559
  g.textBaseline = "middle";
10560
10560
  g.textAlign = "left";
10561
10561
  g.fillText("C\xC0I \u0110\u1EB6T " + ds2.length + " M\u1EE4C", x + 0.04 * W4, y + 0.025 * H2);
10562
10562
  ds2.forEach((t, i) => {
10563
- const yy = y + 0.07 * H2 + i * dh, tick = tuoi > 0.5 + i * 0.18;
10564
- g.font = "700 " + (0.02 * H2).toFixed(1) + "px " + FB;
10563
+ const yy = y + 0.06 * H2 + (i + 0.5) * dh, tick = tuoi > 0.5 + i * 0.18;
10564
+ g.font = "700 " + (0.55 * dh).toFixed(1) + "px " + FB;
10565
10565
  g.fillStyle = "rgb(40,40,48)";
10566
10566
  g.fillText(t, x + 0.11 * W4, yy, w - 0.15 * W4);
10567
10567
  g.strokeStyle = tick ? "rgb(30,180,90)" : "rgba(0,0,0,0.25)";
@@ -18825,6 +18825,13 @@ function lichDoan(clips) {
18825
18825
  });
18826
18826
  t += Math.max(0, e - s);
18827
18827
  });
18828
+ {
18829
+ const nen2 = ra.filter((x) => /^(cmNen|cmAnh|cmKinh)$/.test(String(x.doan && x.doan.loai))).sort((p, q) => p.T0 - q.T0);
18830
+ for (let i = 0; i + 1 < nen2.length; i++) {
18831
+ const x = nen2[i], y = nen2[i + 1];
18832
+ if (y.T0 > x.T0 + 0.05 && y.T0 < x.T1 && x.T1 - y.T0 < 0.1) x.T1 = y.T0;
18833
+ }
18834
+ }
18828
18835
  globalThis.__doanRoi = [...new Set(clips.flatMap((c) => (c.textMoments || []).filter((m) => m.kind === "doan" && !da.has(m))))].map((m) => [+(+m.t0).toFixed(2), +(+m.t1).toFixed(2), m.doan?.loai, m.doan?.bo, m.doan?.giant, clips.filter((c) => c.trimEnd > m.t0 - 1 && c.trimStart < m.t0 + 1).map((c) => [+c.trimStart.toFixed(3), +c.trimEnd.toFixed(3)])]);
18829
18836
  return ra;
18830
18837
  }
@@ -21022,7 +21029,7 @@ function datCauLenh(a) {
21022
21029
  on2 = true;
21023
21030
  window.addEventListener("message", async (ev) => {
21024
21031
  const d = ev.data;
21025
- if (!d || d.xvaiLoi120538 !== true) return;
21032
+ if (!d || d.xvaiLoi120612 !== true) return;
21026
21033
  const o = String(ev.origin || "");
21027
21034
  if (!(o.indexOf("https://flow.google.com") === 0 || o.indexOf("https://labs.google") === 0)) return;
21028
21035
  const tra = (kq) => {