xvai-loi 0.1.129 → 0.1.130

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 +14 -12
package/co.txt CHANGED
@@ -1 +1 @@
1
- xvaiLoi130717
1
+ xvaiLoi130724
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xvai-loi",
3
- "version": "0.1.129",
3
+ "version": "0.1.130",
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
@@ -8750,17 +8750,19 @@ function lapAnhTheoKhuon(kb, ws, K = KHUON_TOPN, toiDa = 12) {
8750
8750
  };
8751
8751
  const g = 60 / K.tram.phut, t0 = W4[0].t0 + K.bien.dau, t1 = W4[W4.length - 1].t1 - K.bien.cuoi;
8752
8752
  {
8753
- let doi = 0;
8754
- const tDau = t0 + (t1 - t0) * K.soTrenAnh.phanDau;
8755
- for (const c of kb.canh) {
8756
- if (doi >= K.soTrenAnh.toiDa || !c || c.kieu !== "so" || !c.tu) continue;
8757
- const i = timTu(c.tu);
8758
- if (i < 0 || W4[i].t0 < t0 || W4[i].t0 > tDau) continue;
8759
- const cau = W4.slice(Math.max(0, i - 5), i + 10).map((w) => w.text).join(" ");
8760
- c.kieu = "anh";
8761
- c.soAnh = 1;
8762
- 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.";
8763
- doi++;
8753
+ const coAnh2 = (a, b) => kb.canh.filter((c) => c && c.tu && /^(anh|ds)$/.test(String(c.kieu)) && ((i) => i >= 0 && W4[i].t0 >= a && W4[i].t0 < b)(timTu(c.tu))).length >= 2, ba = (p) => t0 + (t1 - t0) * p / 3;
8754
+ for (const [a, b] of [[t0, t0 + (t1 - t0) * K.soTrenAnh.phanDau], ...[1, 2].filter((p) => !coAnh2(ba(p), ba(p + 1))).map((p) => [ba(p), ba(p + 1)])]) {
8755
+ let doi = 0;
8756
+ for (const c of kb.canh) {
8757
+ if (doi >= K.soTrenAnh.toiDa || !c || c.kieu !== "so" || !c.tu) continue;
8758
+ const i = timTu(c.tu);
8759
+ if (i < 0 || W4[i].t0 < a || W4[i].t0 > b) continue;
8760
+ const cau = W4.slice(Math.max(0, i - 5), i + 10).map((w) => w.text).join(" ");
8761
+ c.kieu = "anh";
8762
+ c.soAnh = 1;
8763
+ 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.";
8764
+ doi++;
8765
+ }
8764
8766
  }
8765
8767
  }
8766
8768
  const moc = kb.canh.filter(
@@ -20835,7 +20837,7 @@ function datCauLenh(a) {
20835
20837
  on2 = true;
20836
20838
  window.addEventListener("message", async (ev) => {
20837
20839
  const d = ev.data;
20838
- if (!d || d.xvaiLoi130717 !== true) return;
20840
+ if (!d || d.xvaiLoi130724 !== true) return;
20839
20841
  const o = String(ev.origin || "");
20840
20842
  if (!(o.indexOf("https://flow.google.com") === 0 || o.indexOf("https://labs.google") === 0)) return;
20841
20843
  const tra = (kq) => {