Skip to content

Commit 8a969dd

Browse files
committed
test: add <Video> story
1 parent 34422d5 commit 8a969dd

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/Video/__story__/story.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {createElement as h} from 'react';
2+
import {storiesOf} from '@storybook/react';
3+
import {action} from '@storybook/addon-actions';
4+
import {linkTo} from '@storybook/addon-links';
5+
import {Video} from '..';
6+
import ShowDocs from '../../../.storybook/ShowDocs'
7+
8+
const src = 'http://video.dailymail.co.uk/video/mol/2017/10/03/4242224567792913009/1024x576_MP4_4242224567792913009.mp4';
9+
10+
storiesOf('Generators/Video', module)
11+
.add('Documentation', () => h(ShowDocs, {name: 'Video'}))
12+
.add('Example', () =>
13+
<Video autoPlay style={{
14+
width: 400,
15+
border: '1px solid tomato'
16+
}} src={src}>{({video}, {isPlaying}) =>
17+
<div>
18+
{video}
19+
</div>
20+
}</Video>
21+
);

src/Video/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Component, cloneElement, Children} from 'react';
22
import {h, noop} from '../util';
33
import renderProp from '../util/renderProp';
44

5-
export type TVideoEvent = (event, Audio, IAudioState) => void;
5+
export type TVideoEvent = (event, Audio?, IAudioState?) => void;
66
export type TVideoRenderProp = (video: Video, state: IVideoState) => React.ReactElement<any>;
77

88
export interface IVideo {
@@ -14,7 +14,7 @@ export interface IVideo {
1414
unmute();
1515
}
1616

17-
export interface IVideoProps {
17+
export interface IVideoProps extends React.AllHTMLAttributes<any> {
1818
src: string;
1919
children?: TVideoRenderProp;
2020
render?: TVideoRenderProp;

0 commit comments

Comments
 (0)