-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an `AudioPlayer` component that uses https://wavesurfer.xyz behind the scenes.
- Loading branch information
Showing
5 changed files
with
563 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
dotcom-rendering/src/components/AudioPlayer/AudioPlayer.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { defaultFormats } from '../../../.storybook/decorators/splitThemeDecorator'; | ||
import { allModes } from '../../../.storybook/modes'; | ||
import { AudioPlayer as Player } from './AudioPlayer'; | ||
import { audioBlob } from './stories/audio-blob'; | ||
|
||
const meta = { | ||
title: 'Components/Audio Player', | ||
component: Player, | ||
} satisfies Meta<typeof Player>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const AudioPlayer = { | ||
args: { | ||
src: audioBlob, | ||
// src: 'https://audio.guim.co.uk/2024/09/23-66750-gnl.sci.20240923.eb.blue_zone_new.mp3', | ||
}, | ||
parameters: { | ||
// We only want to snapshot the `multipleFormats` version below. | ||
chromatic: { disable: true }, | ||
}, | ||
} satisfies Story; | ||
|
||
export const MultipleFormats = { | ||
args: AudioPlayer.args, | ||
parameters: { | ||
formats: defaultFormats, | ||
chromatic: { | ||
modes: { | ||
horizontal: allModes.splitHorizontal, | ||
}, | ||
}, | ||
}, | ||
} satisfies Story; |
Oops, something went wrong.