Closed tsmith123 closed 4 months ago
The changes introduce support for embedding Rumble videos alongside existing YouTube and Twitter embeds. This includes adding a new function parseEmbedUrl
for URL parsing, updating CSS classes for video containers, and modifying the Content Security Policy to allow Rumble embeds.
Files | Change Summary |
---|---|
components/item-full.js |
Added parseEmbedUrl import, refactored embed handling, added Rumble support. |
components/text.js |
Added parseEmbedUrl for handling YouTube and Rumble embeds. |
components/text.module.css |
Renamed .youtubeContainer to .videoContainer . |
lib/url.js |
Added parseEmbedUrl for parsing YouTube and Rumble URLs. |
middleware.js |
Updated CSP frame-src directive to include rumble.com . |
styles/item.module.css |
Renamed classes for video elements, adjusted styling. |
sequenceDiagram
participant User
participant Frontend
participant Backend
User->>Frontend: Submit URL
Frontend->>Backend: Parse URL with parseEmbedUrl
Backend->>Frontend: Return embed details
Frontend->>User: Display embedded video
Objective (Issue #) | Addressed | Explanation |
---|---|---|
Support for Rumble video embedding (#134) | â | |
Handling of YouTube and Twitter embeds (#134) | â |
[!TIP]
Early Access Features
- `gpt-4o` model for chat
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Adding @benalleng
Code looks great. I'll QA first thing tomorrow
Fixes #134
Description
This PR allows embedding of Rumble videos (using specific embed link). It also adds a util function that:
Testing Notes
Rumble embed links have been tested (https://rumble.com/embed/12345/?pub=4) YouTube traditional links have been tested (https://www.youtube.com/watch?v=12345) YouTube short links have been tested (https://youtu.be/12345) YouTube links with a start time have been tested (https://youtu.be/12345?feature=shared&t=30
Screenshots
Editor View
Limitations
Rumble videos can only be embedded using the embed url specifically and not the video's webpage url. This is something that has been raised a few times already in different discussions so I won't go in to detail again.
There was a suggestion to use domino or something similar to make a request from the backend to the get the details required to support using webpage url like we do for autofilling titles etc. However, this wouldn't work because in the autofill scenario the request is done once and the title can be stored in the database. We don't really have that option for embed links and would make the whole process very messy.
I don't see a way around this unless Rumble starts adding the video id into the webpage url which might never happen. Still think embedding videos using the official embed link is a win though.
Questions
I noticed that Tweets (or should they be called Xs now đ ) are supported in the
item-full.js
component but not thetext.js
component. Is this intentional?Notes
I've not tackled X/Twitter embeds as part of this PR.