From befa3d7a6d063aa15fc8746c8a8d9a03b67a0498 Mon Sep 17 00:00:00 2001 From: safe user Date: Wed, 23 Apr 2025 11:50:40 +0000 Subject: [PATCH] feat: Added embedding for CloudflareStream --- frontend/src/utils/index.js | 7 +++++++ lms/lms/utils.py | 1 + 2 files changed, 8 insertions(+) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 7339f3dd..9c717596 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -258,6 +258,13 @@ export function getEditorTools() { };" frameborder="0" allowfullscreen>`, id: ([id]) => id, }, + cloudflareStream: { + regex: /https:\/\/customer-[a-z0-9]+\.cloudflarestream\.com\/([a-f0-9]{32})\/watch/, + embedUrl: 'https://iframe.videodelivery.net/<%= remote_id %>', + html: ``, + }, codepen: true, aparat: { regex: /(?:http[s]?:\/\/)?(?:www.)?aparat\.com\/v\/([^\/\?\&]+)\/?/, diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 83e219ec..26c4903a 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -181,6 +181,7 @@ def get_lesson_icon(body, content): if block.get("type") == "embed" and block.get("data").get("service") in [ "youtube", "vimeo", + "cloudflareStream" ]: return "icon-youtube"