Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions dotcom-rendering/src/components/SelfHostedVideo.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const meta = {
export default meta;
type Story = StoryObj<typeof SelfHostedVideo>;

export const Loop4to5: Story = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standard cards are all in 5:4 aspect ratio

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name: 'Looping video in 4:5 aspect ratio',
export const Loop5to4: Story = {
name: 'Looping video in 5:4 aspect ratio',
args: {
sources: [
{
Expand All @@ -31,6 +31,7 @@ export const Loop4to5: Story = {
],
uniqueId: 'test-video-1',
atomId: 'test-atom-1',
videoStyle: 'Loop',
height: 720,
width: 900,
posterImage:
Expand Down Expand Up @@ -59,7 +60,7 @@ export const Loop4to5: Story = {
export const Loop16to9: Story = {
name: 'Looping video in 16:9 aspect ratio',
args: {
...Loop4to5.args,
...Loop5to4.args,
sources: [
{
src: 'https://uploads.guim.co.uk/2024/10/01/241001HeleneLoop_2.mp4',
Expand All @@ -73,13 +74,13 @@ export const Loop16to9: Story = {

export const WithCinemagraph: Story = {
args: {
...Loop4to5.args,
...Loop5to4.args,
videoStyle: 'Cinemagraph',
},
};

export const PausePlay: Story = {
...Loop4to5,
...Loop5to4,
name: 'Pause and play interaction',
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
Expand All @@ -100,7 +101,7 @@ export const PausePlay: Story = {
};

export const UnmuteMute: Story = {
...Loop4to5,
...Loop5to4,
name: 'Unmute and mute interaction',
parameters: {
test: {
Expand All @@ -127,7 +128,7 @@ function sleep(ms: number) {
}

export const InteractionObserver: Story = {
...Loop4to5,
...Loop5to4,
name: 'Interaction observer',
render: (args) => (
<div data-testid="test-container">
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/src/components/SelfHostedVideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ type Props = {
sources: Source[];
atomId: string;
uniqueId: string;
width: number;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height typically goes above width everywhere else.

height: number;
width: number;
videoStyle: VideoPlayerFormat;
FallbackImageComponent: ReactElement;
isPlayable: boolean;
Expand Down Expand Up @@ -143,8 +143,8 @@ export const SelfHostedVideoPlayer = forwardRef(
sources,
atomId,
uniqueId,
width,
height,
width,
videoStyle,
FallbackImageComponent,
posterImage,
Expand Down
Loading