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