@quintype/seo 1.44.1 → 1.44.2-fix-brightcove.0

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/index.cjs.js CHANGED
@@ -740,10 +740,6 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
740
740
 
741
741
  function getEmbedUrl(cards) {
742
742
  let embedUrl = "";
743
-
744
- // not using the return value of top level find
745
- // coz we only need the embed url
746
- // find is used for early exit
747
743
  cards.find(card => {
748
744
  const storyElements = get__default["default"](card, ["story-elements"], []);
749
745
  return storyElements.find(elem => {
@@ -751,6 +747,11 @@ function getEmbedUrl(cards) {
751
747
  embedUrl = elem["embed-url"];
752
748
  return true;
753
749
  }
750
+ if (elem.subtype === "brightcove-video" && get__default["default"](elem, ["metadata", "embed-code"])) {
751
+ embedUrl = Buffer.from(elem.metadata["embed-code"], "base64").toString();
752
+ return true;
753
+ }
754
+
754
755
  return false;
755
756
  });
756
757
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/seo",
3
- "version": "1.44.1",
3
+ "version": "1.44.2-fix-brightcove.0",
4
4
  "description": "SEO Modules for Quintype",
5
5
  "main": "dist/index.cjs.js",
6
6
  "repository": "https://github.com/quintype/quintype-node-seo",
@@ -262,10 +262,6 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
262
262
 
263
263
  function getEmbedUrl(cards) {
264
264
  let embedUrl = "";
265
-
266
- // not using the return value of top level find
267
- // coz we only need the embed url
268
- // find is used for early exit
269
265
  cards.find((card) => {
270
266
  const storyElements = get(card, ["story-elements"], []);
271
267
  return storyElements.find((elem) => {
@@ -273,6 +269,11 @@ function getEmbedUrl(cards) {
273
269
  embedUrl = elem["embed-url"];
274
270
  return true;
275
271
  }
272
+ if (elem.subtype === "brightcove-video" && get(elem, ["metadata", "embed-code"])) {
273
+ embedUrl = Buffer.from(elem.metadata["embed-code"], "base64").toString();
274
+ return true;
275
+ }
276
+
276
277
  return false;
277
278
  });
278
279
  });