-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathVideoPlayer.stories.tsx
More file actions
80 lines (76 loc) · 1.76 KB
/
Copy pathVideoPlayer.stories.tsx
File metadata and controls
80 lines (76 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import type {Meta, StoryObj} from '@storybook/react'
import React from 'react'
import posterImage from '../fixtures/images/example-poster.png'
import {VideoPlayer} from '.'
const meta = {
title: 'Components/VideoPlayer',
component: VideoPlayer,
args: {
poster: posterImage,
title: 'GitHub media player',
visuallyHiddenTitle: false,
showBranding: true,
controlsPosition: 'inline',
showControlsWhenPaused: true,
showPlayPauseButton: true,
showSeekControl: true,
showCCButton: true,
showMuteButton: true,
showVolumeControl: true,
showFullScreenButton: true,
},
argTypes: {
poster: {
type: 'string',
description: 'Specify the URL of the poster image',
},
title: {
type: 'string',
description: 'Specify the title of the video',
},
visuallyHiddenTitle: {
type: 'boolean',
},
showBranding: {
type: 'boolean',
},
controlsPosition: {
control: 'select',
options: ['inline', 'bottom'],
},
showControlsWhenPaused: {
type: 'boolean',
},
showPlayPauseButton: {
type: 'boolean',
},
showSeekControl: {
type: 'boolean',
},
showCCButton: {
type: 'boolean',
},
showMuteButton: {
type: 'boolean',
},
showVolumeControl: {
type: 'boolean',
},
showFullScreenButton: {
type: 'boolean',
},
},
} satisfies Meta<typeof VideoPlayer>
export default meta
type Story = StoryObj<typeof VideoPlayer>
export const Playground: Story = {
render: args => (
<VideoPlayer {...args}>
<VideoPlayer.Source src="./example.mp4" type="video/mp4" />
<VideoPlayer.Track src="./example.vtt" default />
</VideoPlayer>
),
}
export const Default: Story = {
...Playground,
}