canvas-editor icon indicating copy to clipboard operation
canvas-editor copied to clipboard

Allow fullscreen and YouTube redirection for embedded YouTube videos

Open igorlicio opened this issue 3 months ago • 1 comments

What problem does this feature solve?

Currently, embedded YouTube videos added via iframe in the editor come with a restrictive sandbox (allow-scripts allow-same-origin), which prevents users from:

  1. Watching the video in fullscreen directly in the editor.
  2. Opening the video in a new tab or redirecting to YouTube using a pop-up.

This limitation negatively impacts the user experience, especially when a more immersive viewing or native YouTube functionality is desired.

What does the proposed API look like?

I suggest allowing the iframe creation to accept additional options, such as:

{
  src: string,
  height?: number,
  width?: number,
  allowFullscreen?: boolean,  // Enables fullscreen
  allowPopup?: boolean        // Allows opening in a new tab or redirecting to YouTube
}

With allowFullscreen: true and allowPopup: true, the iframe could include the necessary attributes (allowfullscreen and allow-presentation) to enable fullscreen and YouTube redirection.

igorlicio avatar Sep 09 '25 16:09 igorlicio

You have found the problem and solution. If you are interested, you can consider directly PR

Hufe921 avatar Sep 10 '25 12:09 Hufe921