@ecency/render-helper 2.4.3 → 2.4.4

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.
@@ -83,8 +83,8 @@ var LBRY_REGEX = /^(https?:)?\/\/lbry.tv\/\$\/embed\/[^?#]+(?:$|[?#])/i;
83
83
  var ODYSEE_REGEX = /^(https?:)?\/\/odysee\.com\/(?:\$|%24)\/embed\/[^/?#]+(?:$|[?#])/i;
84
84
  var SKATEHIVE_IPFS_REGEX = /^https?:\/\/ipfs\.skatehive\.app\/ipfs\/([^/?#]+)/i;
85
85
  var ARCH_REGEX = /^(https?:)?\/\/archive.org\/embed\/[^/?#]+(?:$|[?#])/i;
86
- var SPEAK_REGEX = /(?:https?:\/\/(?:3speak.([a-z]+)\/watch\?v=)|(?:3speak.([a-z]+)\/embed\?v=))([A-Za-z0-9\_\-\.\/]+)(&.*)?/i;
87
- var SPEAK_EMBED_REGEX = /^(https?:)?\/\/3speak.([a-z]+)\/embed\?[^/]+$/i;
86
+ var SPEAK_REGEX = /(?:https?:\/\/(?:(?:play\.)?3speak.([a-z]+)\/watch\?v=)|(?:(?:play\.)?3speak.([a-z]+)\/embed\?v=))([A-Za-z0-9\_\-\.\/]+)(&.*)?/i;
87
+ var SPEAK_EMBED_REGEX = /^(https?:)?\/\/(?:play\.)?3speak.([a-z]+)\/embed\?[^/]+$/i;
88
88
  var TWITTER_REGEX = /(?:https?:\/\/(?:(?:twitter\.com\/(.*?)\/status\/(.*))))/gi;
89
89
  var SPOTIFY_REGEX = /^https:\/\/open\.spotify\.com\/playlist\/(.*)?$/gi;
90
90
  var RUMBLE_REGEX = /^https:\/\/rumble.com\/embed\/([a-zA-Z0-9-]+)\/\?pub=\w+/;
@@ -856,7 +856,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
856
856
  const imgEls2 = el.getElementsByTagName("img");
857
857
  if (imgEls2.length === 1 || el.textContent.trim() === href) {
858
858
  if ((match[1] || match[2]) && match[3]) {
859
- const videoHref = `https://3speak.tv/embed?v=${match[3]}`;
859
+ const videoHref = `https://play.3speak.tv/embed?v=${match[3]}&mode=iframe`;
860
860
  el.setAttribute("class", "markdown-video-link markdown-video-link-speak");
861
861
  el.removeAttribute("href");
862
862
  el.setAttribute("data-embed-src", videoHref);
@@ -989,9 +989,12 @@ function iframe(el, parentDomain = "ecency.com") {
989
989
  return;
990
990
  }
991
991
  if (src.match(SPEAK_EMBED_REGEX)) {
992
- const normalizedSrc = src.replace(/3speak\.[a-z]+/i, "3speak.tv");
992
+ let normalizedSrc = src.replace(/3speak\.[a-z]+/i, "play.3speak.tv");
993
+ if (!/[?&]mode=iframe/.test(normalizedSrc)) {
994
+ normalizedSrc = `${normalizedSrc}${normalizedSrc.includes("?") ? "&" : "?"}mode=iframe`;
995
+ }
993
996
  const hasAutoplay = /[?&]autoplay=/.test(normalizedSrc);
994
- const s = hasAutoplay ? normalizedSrc : `${normalizedSrc}${normalizedSrc.includes("?") ? "&" : "?"}autoplay=true`;
997
+ const s = hasAutoplay ? normalizedSrc : `${normalizedSrc}&autoplay=true`;
995
998
  el.setAttribute("src", s);
996
999
  return;
997
1000
  }