@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.
@@ -77,6 +77,7 @@ var TRUVVL_REGEX = /^https?:\/\/embed.truvvl.com\/(@[\w.\d-]+)\/(.*)/i;
77
77
  var LBRY_REGEX = /^(https?:)?\/\/lbry.tv\/\$\/embed\/[^?#]+(?:$|[?#])/i;
78
78
  var ODYSEE_REGEX = /^(https?:)?\/\/odysee\.com\/(?:\$|%24)\/embed\/[^?#]+(?:$|[?#])/i;
79
79
  var SKATEHIVE_IPFS_REGEX = /^https?:\/\/ipfs\.skatehive\.app\/ipfs\/([^/?#]+)/i;
80
+ var SKATEHYPE_EMBED_REGEX = /^(https?:)?\/\/(www\.)?skatehype\.com\/ifplay\.php\?v=\d+(?:$|[&#])/i;
80
81
  var ARCH_REGEX = /^(https?:)?\/\/archive.org\/embed\/[^/?#]+(?:$|[?#])/i;
81
82
  var SPEAK_REGEX = /(?:https?:\/\/(?:(?:play\.)?3speak\.([a-z]+)\/watch\?v=)|(?:(?:play\.)?3speak\.([a-z]+)\/embed\?v=))([A-Za-z0-9_\-\.\/]+)(&.*)?/i;
82
83
  var SPEAK_EMBED_REGEX = /^(https?:)?\/\/(?:play\.)?3speak\.([a-z]+)\/(?:embed|watch)\?.+$/i;
@@ -1396,6 +1397,13 @@ function iframe(el, parentDomain = "ecency.com", forApp = false) {
1396
1397
  el.setAttribute("allowfullscreen", "true");
1397
1398
  return;
1398
1399
  }
1400
+ if (src.match(SKATEHYPE_EMBED_REGEX)) {
1401
+ const normalizedSrc = src.replace(/^(https?:)?\/\//i, "https://");
1402
+ el.setAttribute("src", normalizedSrc);
1403
+ el.setAttribute("frameborder", "0");
1404
+ el.setAttribute("allowfullscreen", "true");
1405
+ return;
1406
+ }
1399
1407
  if (src.match(ARCH_REGEX)) {
1400
1408
  el.setAttribute("src", src);
1401
1409
  return;