@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.
package/dist/node/index.cjs
CHANGED
|
@@ -1044,7 +1044,7 @@ function a(el, forApp, parentDomain = "ecency.com", seoContext) {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
|
|
1046
1046
|
// src/methods/iframe.method.ts
|
|
1047
|
-
function iframe(el, parentDomain = "ecency.com") {
|
|
1047
|
+
function iframe(el, parentDomain = "ecency.com", forApp = false) {
|
|
1048
1048
|
if (!el || !el.parentNode) {
|
|
1049
1049
|
return;
|
|
1050
1050
|
}
|
|
@@ -1088,7 +1088,10 @@ function iframe(el, parentDomain = "ecency.com") {
|
|
|
1088
1088
|
normalizedSrc = `${normalizedSrc}&mode=iframe`;
|
|
1089
1089
|
}
|
|
1090
1090
|
const hasAutoplay = /[?&]autoplay=/.test(normalizedSrc);
|
|
1091
|
-
|
|
1091
|
+
let s = hasAutoplay ? normalizedSrc : `${normalizedSrc}&autoplay=true`;
|
|
1092
|
+
if (forApp && !/[?&]layout=/.test(s)) {
|
|
1093
|
+
s = `${s}&layout=mobile`;
|
|
1094
|
+
}
|
|
1092
1095
|
el.setAttribute("src", s);
|
|
1093
1096
|
el.setAttribute("class", "speak-iframe");
|
|
1094
1097
|
return;
|
|
@@ -1380,7 +1383,7 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
1380
1383
|
a(child, forApp, parentDomain, seoContext);
|
|
1381
1384
|
}
|
|
1382
1385
|
if (child.nodeName.toLowerCase() === "iframe") {
|
|
1383
|
-
iframe(child, parentDomain);
|
|
1386
|
+
iframe(child, parentDomain, forApp);
|
|
1384
1387
|
}
|
|
1385
1388
|
if (child.nodeName === "#text") {
|
|
1386
1389
|
text(child, forApp);
|