Skip to content

Commit

Permalink
🤖 Merge PR #69628 [video-react] Make all props of PlayerProps optiona…
Browse files Browse the repository at this point in the history
…l by @Gcommer
  • Loading branch information
Gcommer committed May 17, 2024
1 parent 4f7cc7d commit 425f0eb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
10 changes: 5 additions & 5 deletions types/video-react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,23 +310,23 @@ export interface PlayerProps extends RefAttributes<PlayerReference> {
/**
* Event on Play
*/
onPlay: () => void;
onPlay?: () => void;
/**
* Event on Ended
*/
onEnded: () => void;
onEnded?: () => void;
/**
* Event on Load start
*/
onLoadStart: () => void;
onLoadStart?: () => void;
/**
* Event on Pause start
*/
onPause: () => void;
onPause?: () => void;
/**
* Set the id of the video element.
*/
videoId: string;
videoId?: string;

children?: React.ReactNode;
}
Expand Down
26 changes: 18 additions & 8 deletions types/video-react/video-react-tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@ const testProps: PlayerProps = {

function TestComponent(props: PlayerProps): React.JSX.Element {
return (
<Player {...testProps}>
<ControlBar>
<CurrentTimeDisplay order={1} />
<DurationDisplay order={2} />
<ProgressControl order={3} />
<TimeDivider order={4} />
</ControlBar>
</Player>
<div>
<Player>
<ControlBar>
<CurrentTimeDisplay order={1} />
<DurationDisplay order={2} />
<ProgressControl order={3} />
<TimeDivider order={4} />
</ControlBar>
</Player>
<Player {...testProps}>
<ControlBar>
<CurrentTimeDisplay order={1} />
<DurationDisplay order={2} />
<ProgressControl order={3} />
<TimeDivider order={4} />
</ControlBar>
</Player>
</div>
);
}

0 comments on commit 425f0eb

Please sign in to comment.