xvai-loi 0.1.75 → 0.1.76

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 +18 -2
package/co.txt CHANGED
@@ -1 +1 @@
1
- xvaiLoi112023
1
+ xvaiLoi112057
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xvai-loi",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
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
@@ -9827,6 +9827,8 @@ var KHUON_TOPN = {
9827
9827
  cat: { moi10s: [4, 6] },
9828
9828
  nguoi: { phongToiDa: 1.8, matToiDa: 0.55 },
9829
9829
  // matToiDa: hộp đầu (tóc→cằm) cao hơn 0,55 H thì KHÔNG dùng ô người / chia (không vừa ô) // MỌI ô người (PIP, thẻ, chia) phóng khung gốc tối đa 1,8× (độ nét) — trước: PIP 1,6, thẻ 1,3 (B05-1027: thẻ hiện cả người nhỏ)
9830
+ soTrenAnh: { phanDau: 1 / 3, toiDa: 2 },
9831
+ // cảnh CON SỐ ở 1/3 đầu → số đè lên ẢNH minh hoạ (đối thủ 1/3 đầu 83 % trám; số trên người nói không tính trám)
9830
9832
  bien: { dau: 1.5, cuoi: 2.5, ctaAnh: true }
9831
9833
  // không đặt ảnh trám ở 1,5 s đầu (móc; bàn thử 13 video: 3 → 1,5 s nâng 1/3 đầu T2 63→87, B05 23→42, B08 25→45, không video nào tụt) và 2,5 s cuối; vùng CTA VẪN có ảnh (đối thủ CTA 8,7 s vẫn trám)
9832
9834
  };
@@ -9850,6 +9852,20 @@ function lapAnhTheoKhuon(kb, ws, K = KHUON_TOPN, toiDa = 12) {
9850
9852
  return -1;
9851
9853
  };
9852
9854
  const g = 60 / K.tram.phut, t0 = W4[0].t0 + K.bien.dau, t1 = W4[W4.length - 1].t1 - K.bien.cuoi;
9855
+ {
9856
+ let doi = 0;
9857
+ const tDau = t0 + (t1 - t0) * K.soTrenAnh.phanDau;
9858
+ for (const c of kb.canh) {
9859
+ if (doi >= K.soTrenAnh.toiDa || !c || c.kieu !== "so" || !c.tu) continue;
9860
+ const i = timTu(c.tu);
9861
+ if (i < 0 || W4[i].t0 < t0 || W4[i].t0 > tDau) continue;
9862
+ const cau = W4.slice(Math.max(0, i - 5), i + 10).map((w) => w.text).join(" ");
9863
+ c.kieu = "anh";
9864
+ c.soAnh = 1;
9865
+ c.en = 'Cinematic photorealistic vertical photo that illustrates the meaning of this Vietnamese sentence: "' + cau + '". ' + K.tram.nhanVat[doi % 2] + " Natural light, no text, no captions.";
9866
+ doi++;
9867
+ }
9868
+ }
9853
9869
  const moc = kb.canh.filter(
9854
9870
  (c) => c && c.tu && /^(anh|ds)$/.test(String(c.kieu))
9855
9871
  /* 'so' vẽ thành chữ to trên người / ô tròn (cut/tron) — không phải trám */
@@ -20770,7 +20786,7 @@ async function napLoi(d) {
20770
20786
  return "LOI: " + String(e && e.message || e).slice(0, 300);
20771
20787
  }
20772
20788
  }
20773
- var LOI_URL = "https://cdn.jsdelivr.net/npm/xvai-loi@0.1.64/nap.js";
20789
+ var LOI_URL = "https://cdn.jsdelivr.net/npm/xvai-loi@0.1.75/nap.js";
20774
20790
  var TRONG_LOI = !!globalThis.__xvaiReact;
20775
20791
  try {
20776
20792
  if (!TRONG_LOI) setTimeout(() => {
@@ -20800,7 +20816,7 @@ function datCauLenh(a) {
20800
20816
  on2 = true;
20801
20817
  window.addEventListener("message", async (ev) => {
20802
20818
  const d = ev.data;
20803
- if (!d || d.xvaiLoi112023 !== true) return;
20819
+ if (!d || d.xvaiLoi112057 !== true) return;
20804
20820
  const o = String(ev.origin || "");
20805
20821
  if (!(o.indexOf("https://flow.google.com") === 0 || o.indexOf("https://labs.google") === 0)) return;
20806
20822
  const tra = (kq) => {