@ecency/render-helper 2.5.6 → 2.5.7

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.
@@ -106,6 +106,7 @@ var TRUVVL_REGEX = /^https?:\/\/embed.truvvl.com\/(@[\w.\d-]+)\/(.*)/i;
106
106
  var LBRY_REGEX = /^(https?:)?\/\/lbry.tv\/\$\/embed\/[^?#]+(?:$|[?#])/i;
107
107
  var ODYSEE_REGEX = /^(https?:)?\/\/odysee\.com\/(?:\$|%24)\/embed\/[^?#]+(?:$|[?#])/i;
108
108
  var SKATEHIVE_IPFS_REGEX = /^https?:\/\/ipfs\.skatehive\.app\/ipfs\/([^/?#]+)/i;
109
+ var SKATEHYPE_EMBED_REGEX = /^(https?:)?\/\/(www\.)?skatehype\.com\/ifplay\.php\?v=\d+(?:$|[&#])/i;
109
110
  var ARCH_REGEX = /^(https?:)?\/\/archive.org\/embed\/[^/?#]+(?:$|[?#])/i;
110
111
  var SPEAK_REGEX = /(?:https?:\/\/(?:(?:play\.)?3speak\.([a-z]+)\/watch\?v=)|(?:(?:play\.)?3speak\.([a-z]+)\/embed\?v=))([A-Za-z0-9_\-\.\/]+)(&.*)?/i;
111
112
  var SPEAK_EMBED_REGEX = /^(https?:)?\/\/(?:play\.)?3speak\.([a-z]+)\/(?:embed|watch)\?.+$/i;
@@ -1425,6 +1426,13 @@ function iframe(el, parentDomain = "ecency.com", forApp = false) {
1425
1426
  el.setAttribute("allowfullscreen", "true");
1426
1427
  return;
1427
1428
  }
1429
+ if (src.match(SKATEHYPE_EMBED_REGEX)) {
1430
+ const normalizedSrc = src.replace(/^(https?:)?\/\//i, "https://");
1431
+ el.setAttribute("src", normalizedSrc);
1432
+ el.setAttribute("frameborder", "0");
1433
+ el.setAttribute("allowfullscreen", "true");
1434
+ return;
1435
+ }
1428
1436
  if (src.match(ARCH_REGEX)) {
1429
1437
  el.setAttribute("src", src);
1430
1438
  return;