From 726f7334349aeb6a5426f362c5ce29db7117b285 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 21 Apr 2025 15:41:51 +0530 Subject: [PATCH] fix: allow fullscreen on vimeo and adjust video height on mobile devices --- frontend/src/utils/index.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index b3f87c97..7339f3dd 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -201,9 +201,9 @@ export function getEditorTools() { regex: /(?:https?:\/\/)?(?:www\.)?(?:(?:youtu\.be\/)|(?:youtube\.com)\/(?:v\/|u\/\w\/|embed\/|watch))(?:(?:\?v=)?([^#&?=]*))?((?:[?&]\w*=\w*)*)/, embedUrl: 'https://www.youtube.com/embed/<%= remote_id %>', - html: '', - height: 320, - width: 580, + html: ``, id: ([id, params]) => { if (!params && id) { return id @@ -249,28 +249,40 @@ export function getEditorTools() { return id + '?' + newParams.join('&') }, }, - vimeo: true, + vimeo: { + regex: /(?:http[s]?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/, + embedUrl: + 'https://player.vimeo.com/video/<%= remote_id %>', + html: ``, + id: ([id]) => id, + }, codepen: true, aparat: { regex: /(?:http[s]?:\/\/)?(?:www.)?aparat\.com\/v\/([^\/\?\&]+)\/?/, embedUrl: 'https://www.aparat.com/video/video/embed/videohash/<%= remote_id %>/vt/frame', - html: '', - height: 300, - width: 600, + html: ``, }, github: true, slides: { regex: /https:\/\/docs\.google\.com\/presentation\/d\/([A-Za-z0-9_-]+)\/pub/, embedUrl: 'https://docs.google.com/presentation/d/<%= remote_id %>/embed', - html: "", + html: ``, }, drive: { regex: /https:\/\/drive\.google\.com\/file\/d\/([A-Za-z0-9_-]+)\/view(\?.+)?/, embedUrl: 'https://drive.google.com/file/d/<%= remote_id %>/preview', - html: "", + html: ``, }, docsPublic: { regex: /https:\/\/docs\.google\.com\/document\/d\/([A-Za-z0-9_-]+)\/edit(\?.+)?/,