From 74b5715915a23e7086853c5103002ca9e86ee162 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Fri, 16 May 2025 14:55:27 +0300 Subject: [PATCH] fix: handle autoplay property in youtube and vimeo We have issue with distincting html attributes and component properties. I have an idea for proper fix. For now fast fix with just aliasing autoplay and autoPlay. --- packages/sdk-components-react/src/vimeo.tsx | 5 ++++- packages/sdk-components-react/src/youtube.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/sdk-components-react/src/vimeo.tsx b/packages/sdk-components-react/src/vimeo.tsx index bac64c6f8cc5..643dffe73b6a 100644 --- a/packages/sdk-components-react/src/vimeo.tsx +++ b/packages/sdk-components-react/src/vimeo.tsx @@ -352,6 +352,8 @@ type Props = Omit, keyof VimeoOptions> & * Example: "Video about web development tips". */ title?: string | undefined; + // temporary prop until props render is fixed + autoPlay?: boolean; }; type Ref = ElementRef; @@ -360,7 +362,8 @@ export const Vimeo = forwardRef( { url, loading = "lazy", - autoplay = false, + autoPlay, + autoplay = autoPlay ?? false, autopause = true, showByline = false, showControls = true, diff --git a/packages/sdk-components-react/src/youtube.tsx b/packages/sdk-components-react/src/youtube.tsx index 1c6e5d58a934..77e1344d1114 100644 --- a/packages/sdk-components-react/src/youtube.tsx +++ b/packages/sdk-components-react/src/youtube.tsx @@ -470,6 +470,8 @@ type Props = Omit< * Example: "Video about web development tips". */ title?: string | undefined; + // temporary prop until props render is fixed + autoPlay?: boolean; }; type Ref = ElementRef; @@ -478,7 +480,8 @@ export const YouTube = forwardRef( { url, loading = "lazy", - autoplay, + autoPlay, + autoplay = autoPlay ?? false, showPreview, showAnnotations, showCaptions,