owncast/web/stories/Video.stories.tsx

38 lines
960 B
TypeScript
Raw Normal View History

2022-04-26 23:39:35 +03:00
import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { RecoilRoot } from 'recoil';
import OwncastPlayer from '../components/video/OwncastPlayer';
2022-04-27 05:29:13 +03:00
const streams = {
2022-05-11 01:36:09 +03:00
DemoServer: `https://watch.owncast.online/hls/stream.m3u8`,
RetroStrangeTV: `https://live.retrostrange.com/hls/stream.m3u8`,
localhost: `http://localhost:8080/hls/stream.m3u8`,
2022-04-27 05:29:13 +03:00
};
2022-04-26 23:39:35 +03:00
export default {
2022-05-13 03:59:40 +03:00
title: 'owncast/Player/Player',
2022-04-27 05:29:13 +03:00
component: OwncastPlayer,
argTypes: {
source: {
options: Object.keys(streams),
mapping: streams,
control: {
type: 'select',
},
},
},
2022-04-26 23:39:35 +03:00
parameters: {},
2022-04-27 05:29:13 +03:00
} as ComponentMeta<typeof OwncastPlayer>;
2022-04-26 23:39:35 +03:00
const Template: ComponentStory<typeof OwncastPlayer> = args => (
<RecoilRoot>
<OwncastPlayer {...args} />
</RecoilRoot>
);
2022-04-26 23:39:35 +03:00
2022-04-27 05:29:13 +03:00
export const LiveDemo = Template.bind({});
LiveDemo.args = {
online: true,
2022-05-11 01:36:09 +03:00
source: 'https://watch.owncast.online/hls/stream.m3u8',
2022-04-27 05:29:13 +03:00
};