Skip to content

Commit 29a2cf0

Browse files
committed
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.
1 parent 9b2108d commit 29a2cf0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/sdk-components-react/src/vimeo.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ type Props = Omit<ComponentProps<typeof defaultTag>, keyof VimeoOptions> &
352352
* Example: "Video about web development tips".
353353
*/
354354
title?: string | undefined;
355+
// temporary prop until props render is fixed
356+
autoPlay?: boolean;
355357
};
356358
type Ref = ElementRef<typeof defaultTag>;
357359

@@ -360,7 +362,8 @@ export const Vimeo = forwardRef<Ref, Props>(
360362
{
361363
url,
362364
loading = "lazy",
363-
autoplay = false,
365+
autoPlay,
366+
autoplay = autoPlay ?? false,
364367
autopause = true,
365368
showByline = false,
366369
showControls = true,

packages/sdk-components-react/src/youtube.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ type Props = Omit<
470470
* Example: "Video about web development tips".
471471
*/
472472
title?: string | undefined;
473+
// temporary prop until props render is fixed
474+
autoPlay?: boolean;
473475
};
474476
type Ref = ElementRef<typeof defaultTag>;
475477

@@ -478,7 +480,8 @@ export const YouTube = forwardRef<Ref, Props>(
478480
{
479481
url,
480482
loading = "lazy",
481-
autoplay,
483+
autoPlay,
484+
autoplay = autoPlay ?? false,
482485
showPreview,
483486
showAnnotations,
484487
showCaptions,

0 commit comments

Comments
 (0)