@ecency/render-helper 2.4.24 → 2.4.25

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.
@@ -1012,7 +1012,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
1012
1012
  }
1013
1013
 
1014
1014
  // src/methods/iframe.method.ts
1015
- function iframe(el, parentDomain = "ecency.com") {
1015
+ function iframe(el, parentDomain = "ecency.com", forApp = false) {
1016
1016
  if (!el || !el.parentNode) {
1017
1017
  return;
1018
1018
  }
@@ -1056,7 +1056,10 @@ function iframe(el, parentDomain = "ecency.com") {
1056
1056
  normalizedSrc = `${normalizedSrc}&mode=iframe`;
1057
1057
  }
1058
1058
  const hasAutoplay = /[?&]autoplay=/.test(normalizedSrc);
1059
- const s = hasAutoplay ? normalizedSrc : `${normalizedSrc}&autoplay=true`;
1059
+ let s = hasAutoplay ? normalizedSrc : `${normalizedSrc}&autoplay=true`;
1060
+ if (forApp && !/[?&]layout=/.test(s)) {
1061
+ s = `${s}&layout=mobile`;
1062
+ }
1060
1063
  el.setAttribute("src", s);
1061
1064
  el.setAttribute("class", "speak-iframe");
1062
1065
  return;
@@ -1348,7 +1351,7 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
1348
1351
  a(child, forApp, parentDomain, seoContext);
1349
1352
  }
1350
1353
  if (child.nodeName.toLowerCase() === "iframe") {
1351
- iframe(child, parentDomain);
1354
+ iframe(child, parentDomain, forApp);
1352
1355
  }
1353
1356
  if (child.nodeName === "#text") {
1354
1357
  text(child, forApp);