canvas-editor
canvas-editor copied to clipboard
Allow fullscreen and YouTube redirection for embedded YouTube videos
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:
- Watching the video in fullscreen directly in the editor.
- 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.
You have found the problem and solution. If you are interested, you can consider directly PR