@hyperframes/producer 0.9.40 → 0.9.41

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/dist/index.js CHANGED
@@ -6521,6 +6521,7 @@ import {
6521
6521
  rewriteInlineStyleAssetUrls
6522
6522
  } from "@hyperframes/core";
6523
6523
  import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
6524
+ import { CAPTURE_CANVAS_SELECTOR } from "@hyperframes/core/html-in-canvas";
6524
6525
  import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
6525
6526
  import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
6526
6527
  import { gsapCdnDist as gsapCdnDist2, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
@@ -7651,7 +7652,7 @@ function runtimeRoot(document2) {
7651
7652
  function detectRenderModeHints(html, pageMotionBlur) {
7652
7653
  const reasons = [];
7653
7654
  const { document: document2 } = parseHTML5(html);
7654
- if (document2.querySelector("canvas[layoutsubtree]")) {
7655
+ if (document2.querySelector(CAPTURE_CANVAS_SELECTOR)) {
7655
7656
  reasons.push({
7656
7657
  code: "htmlInCanvas",
7657
7658
  message: "Detected html-in-canvas API (layoutsubtree canvas). Chrome does not support concurrent drawElementImage across multiple workers; render is pinned to a single worker."
@@ -7659,7 +7660,7 @@ function detectRenderModeHints(html, pageMotionBlur) {
7659
7660
  } else if (pageMotionBlur !== "off" && runtimeRoot(document2)?.getAttribute("data-motion-blur") === "on") {
7660
7661
  reasons.push({
7661
7662
  code: "captureMotionBlur",
7662
- message: 'Detected capture motion blur (data-motion-blur="on"), which draws each frame with html-in-canvas; routed through screenshot capture mode.'
7663
+ message: 'Detected motion blur (data-motion-blur="on"), drawn per frame with an SVG filter or, on the capture tier, html-in-canvas; routed through screenshot capture mode.'
7663
7664
  });
7664
7665
  }
7665
7666
  if (document2.querySelector("iframe")) {
@@ -8400,13 +8401,26 @@ async function localizeRemoteMediaSources(html, downloadDir) {
8400
8401
  if (m[1]) urlSet.add(m[1]);
8401
8402
  }
8402
8403
  }
8403
- return downloadAndRewriteUrls(
8404
+ const localized = await downloadAndRewriteUrls(
8404
8405
  urlSet,
8405
8406
  html,
8406
8407
  join19(downloadDir, REMOTE_MEDIA_SUBDIR),
8407
8408
  "Remote media download failed",
8408
8409
  "Localized remote media source(s)"
8409
8410
  );
8411
+ return { ...localized, html: dropBindingOnLocalizedMedia(localized.html) };
8412
+ }
8413
+ function dropBindingOnLocalizedMedia(html) {
8414
+ if (!html.includes("data-var-src")) return html;
8415
+ const { document: document2 } = parseHTML5(html);
8416
+ let changed = false;
8417
+ for (const el of document2.querySelectorAll("video[data-var-src], audio[data-var-src]")) {
8418
+ if (el.closest("[data-variable-values]")) continue;
8419
+ if (!el.getAttribute("src")?.startsWith(`${REMOTE_MEDIA_SUBDIR}/`)) continue;
8420
+ el.removeAttribute("data-var-src");
8421
+ changed = true;
8422
+ }
8423
+ return changed ? document2.toString() : html;
8410
8424
  }
8411
8425
  async function localizeRemoteImageSources(html, downloadDir) {
8412
8426
  const urlSet = /* @__PURE__ */ new Set();
@@ -6534,6 +6534,7 @@ import {
6534
6534
  rewriteInlineStyleAssetUrls
6535
6535
  } from "@hyperframes/core";
6536
6536
  import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
6537
+ import { CAPTURE_CANVAS_SELECTOR } from "@hyperframes/core/html-in-canvas";
6537
6538
  import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
6538
6539
  import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
6539
6540
  import { gsapCdnDist as gsapCdnDist2, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
@@ -7664,7 +7665,7 @@ function runtimeRoot(document2) {
7664
7665
  function detectRenderModeHints(html, pageMotionBlur) {
7665
7666
  const reasons = [];
7666
7667
  const { document: document2 } = parseHTML5(html);
7667
- if (document2.querySelector("canvas[layoutsubtree]")) {
7668
+ if (document2.querySelector(CAPTURE_CANVAS_SELECTOR)) {
7668
7669
  reasons.push({
7669
7670
  code: "htmlInCanvas",
7670
7671
  message: "Detected html-in-canvas API (layoutsubtree canvas). Chrome does not support concurrent drawElementImage across multiple workers; render is pinned to a single worker."
@@ -7672,7 +7673,7 @@ function detectRenderModeHints(html, pageMotionBlur) {
7672
7673
  } else if (pageMotionBlur !== "off" && runtimeRoot(document2)?.getAttribute("data-motion-blur") === "on") {
7673
7674
  reasons.push({
7674
7675
  code: "captureMotionBlur",
7675
- message: 'Detected capture motion blur (data-motion-blur="on"), which draws each frame with html-in-canvas; routed through screenshot capture mode.'
7676
+ message: 'Detected motion blur (data-motion-blur="on"), drawn per frame with an SVG filter or, on the capture tier, html-in-canvas; routed through screenshot capture mode.'
7676
7677
  });
7677
7678
  }
7678
7679
  if (document2.querySelector("iframe")) {
@@ -8413,13 +8414,26 @@ async function localizeRemoteMediaSources(html, downloadDir) {
8413
8414
  if (m[1]) urlSet.add(m[1]);
8414
8415
  }
8415
8416
  }
8416
- return downloadAndRewriteUrls(
8417
+ const localized = await downloadAndRewriteUrls(
8417
8418
  urlSet,
8418
8419
  html,
8419
8420
  join19(downloadDir, REMOTE_MEDIA_SUBDIR),
8420
8421
  "Remote media download failed",
8421
8422
  "Localized remote media source(s)"
8422
8423
  );
8424
+ return { ...localized, html: dropBindingOnLocalizedMedia(localized.html) };
8425
+ }
8426
+ function dropBindingOnLocalizedMedia(html) {
8427
+ if (!html.includes("data-var-src")) return html;
8428
+ const { document: document2 } = parseHTML5(html);
8429
+ let changed = false;
8430
+ for (const el of document2.querySelectorAll("video[data-var-src], audio[data-var-src]")) {
8431
+ if (el.closest("[data-variable-values]")) continue;
8432
+ if (!el.getAttribute("src")?.startsWith(`${REMOTE_MEDIA_SUBDIR}/`)) continue;
8433
+ el.removeAttribute("data-var-src");
8434
+ changed = true;
8435
+ }
8436
+ return changed ? document2.toString() : html;
8423
8437
  }
8424
8438
  async function localizeRemoteImageSources(html, downloadDir) {
8425
8439
  const urlSet = /* @__PURE__ */ new Set();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.40",
3
+ "version": "0.9.41",
4
4
  "description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,11 +35,11 @@
35
35
  "postcss": "^8.4.0",
36
36
  "puppeteer": "~25.11.0",
37
37
  "puppeteer-core": "^25.11.0",
38
- "@hyperframes/core": "0.9.40",
39
- "@hyperframes/lint": "0.9.40",
40
- "@hyperframes/studio-server": "0.9.40",
41
- "@hyperframes/parsers": "0.9.40",
42
- "@hyperframes/engine": "0.9.40"
38
+ "@hyperframes/core": "0.9.41",
39
+ "@hyperframes/engine": "0.9.41",
40
+ "@hyperframes/lint": "0.9.41",
41
+ "@hyperframes/studio-server": "0.9.41",
42
+ "@hyperframes/parsers": "0.9.41"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^25.0.10",
@@ -48,7 +48,7 @@
48
48
  "tsx": "^4.21.0",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^4.1.11",
51
- "@hyperframes/aws-lambda": "0.9.40"
51
+ "@hyperframes/aws-lambda": "0.9.41"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"