From 81520bdcc8b1fc486ae1ad6ed3553e3507691f61 Mon Sep 17 00:00:00 2001 From: Graeme Fulton Date: Mon, 24 Jun 2024 12:14:03 -0400 Subject: [PATCH] gumlet --- .../Editor/CustomExtensions/Figure2/Figure.js | 1 - components/Editor/CustomExtensions/Video/Video.js | 15 +++++++-------- .../CustomExtensions/Video/VideoComponent.js | 0 pages/api/post/uploadVideoToGumlet.js | 6 +++--- 4 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 components/Editor/CustomExtensions/Video/VideoComponent.js diff --git a/components/Editor/CustomExtensions/Figure2/Figure.js b/components/Editor/CustomExtensions/Figure2/Figure.js index a6c63129..4f38697b 100644 --- a/components/Editor/CustomExtensions/Figure2/Figure.js +++ b/components/Editor/CustomExtensions/Figure2/Figure.js @@ -341,7 +341,6 @@ const Figure = Node.create({ .run() ); } else if (attrs.figureType == "video") { - console.log(attrs) const content = [{ type: "video", attrs }]; // if (caption) { diff --git a/components/Editor/CustomExtensions/Video/Video.js b/components/Editor/CustomExtensions/Video/Video.js index ccadd074..1a56f56b 100644 --- a/components/Editor/CustomExtensions/Video/Video.js +++ b/components/Editor/CustomExtensions/Video/Video.js @@ -54,14 +54,13 @@ const Video = Node.create({ }, renderHTML({ HTMLAttributes }) { - console.log(HTMLAttributes) - if (HTMLAttributes.gumlet) { - let gumletJSON = JSON.parse(HTMLAttributes.gumlet); - console.log(gumletJSON) - // if (gumletJSON.output?.playback_url) { - // HTMLAttributes.src = gumletJSON.output?.playback_url; - // } - } + + // if (HTMLAttributes.gumlet) { + // let gumletJSON = JSON.parse(HTMLAttributes.gumlet); + // if (gumletJSON.output?.playback_url) { + // HTMLAttributes.src = gumletJSON.output?.playback_url; + // } + // } return ["video", mergeAttributes(HTMLAttributes)]; }, diff --git a/components/Editor/CustomExtensions/Video/VideoComponent.js b/components/Editor/CustomExtensions/Video/VideoComponent.js new file mode 100644 index 00000000..e69de29b diff --git a/pages/api/post/uploadVideoToGumlet.js b/pages/api/post/uploadVideoToGumlet.js index 2a2db51c..cc5f16ea 100644 --- a/pages/api/post/uploadVideoToGumlet.js +++ b/pages/api/post/uploadVideoToGumlet.js @@ -31,12 +31,12 @@ async function handler(req, res) { headers: { accept: "application/json", "content-type": "application/json", - Authorization: "Bearer [bearer otken here]", + Authorization: `Bearer ${process.env.GUMLET_API_KEY}`, }, body: JSON.stringify({ - format: "ABR", + format: "MP4", input: videoUrl, - collection_id: "[collection id here]", + collection_id: process.env.GUMLET_COLLECTION_ID, }), };