Skip to content

allow other sources in Video block #6870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: 18.x.x
Choose a base branch
from

Conversation

ionlizarazu
Copy link
Contributor

@ionlizarazu ionlizarazu commented Mar 25, 2025

Caution

The Volto Team has suspended its review of new pull requests from first-time contributors until the release of Plone 7, which is preliminarily scheduled for the second quarter of 2026.
Read details.



If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes #


if (url) {
if (url.match('youtu')) {
if (url.match(/youtu.*?(list|live|\?v=|\.be\/|shorts)/)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also support www.youtube-nocookie.com, which is the same as www.youtube.com but is compliant with GDPR. See https://6.docs.plone.org/contributing/documentation/myst-reference.html#video-remote. It is currently not supported with this change. See https://regex101.com/r/8Op0g1/1.

I'd also like to support for YouTube privacy_mode=1 and for Vimeo dnt=1 GET parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The youtube-nocookie url is directly an embed. This should be a feature request: "Generate a youtube-nocookie embed url when adding a youtube video."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also support www.youtube-nocookie.com, which is the same as www.youtube.com but is compliant with GDPR. See https://6.docs.plone.org/contributing/documentation/myst-reference.html#video-remote. It is currently not supported with this change. See https://regex101.com/r/8Op0g1/1.

I'd also like to support for YouTube privacy_mode=1 and for Vimeo dnt=1 GET parameters.

This block is to paste a URL copied from YouTube, not to paste the embed code that YouTube provides when you want to embed it in your site.

I mean, that the user will always paste the current URL of the YouTube video, they will never paste a www.youtube-nocookies.com URL.

An enhancement would be to generate the www.youtube-nocookies.com URL for any YouTube URL entered, but this is not the scope of this PR.

We just want to support additional video sources apart from the provided youtube and vimeo, like Peertube instances and YouTube shorts, which on their own have a URL.

Comment on lines +42 to +43
} else if (url.match('shorts')) {
videoID = url.match(/^.*\/shorts\/(.*)/)[1];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a case for embed for both www.youtube.com and www.youtube-nocookie.com.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not work that way. This would be a breaking change because we sould modify the use of https://react.semantic-ui.com/modules/embed/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants