2023-11-07 12:35:05 +09:00
|
|
|
import { StoryFn, Meta } from '@storybook/react';
|
2022-05-25 20:38:40 -07:00
|
|
|
import { RecoilRoot } from 'recoil';
|
2022-09-07 09:00:28 +02:00
|
|
|
import { OwncastPlayer } from './OwncastPlayer';
|
2022-04-26 19:29:13 -07:00
|
|
|
|
|
|
|
const streams = {
|
2022-05-10 15:36:09 -07: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-26 19:29:13 -07:00
|
|
|
};
|
2022-04-26 13:39:35 -07:00
|
|
|
|
2023-11-07 12:35:05 +09:00
|
|
|
const meta = {
|
2022-05-12 17:59:40 -07:00
|
|
|
title: 'owncast/Player/Player',
|
2022-04-26 19:29:13 -07:00
|
|
|
component: OwncastPlayer,
|
|
|
|
argTypes: {
|
|
|
|
source: {
|
|
|
|
options: Object.keys(streams),
|
|
|
|
mapping: streams,
|
|
|
|
control: {
|
|
|
|
type: 'select',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-04-26 13:39:35 -07:00
|
|
|
parameters: {},
|
2023-11-07 12:35:05 +09:00
|
|
|
} satisfies Meta<typeof OwncastPlayer>;
|
2022-04-26 13:39:35 -07:00
|
|
|
|
2023-11-07 12:35:05 +09:00
|
|
|
export default meta;
|
|
|
|
|
|
|
|
const Template: StoryFn<typeof OwncastPlayer> = args => (
|
2022-05-25 20:38:40 -07:00
|
|
|
<RecoilRoot>
|
|
|
|
<OwncastPlayer {...args} />
|
|
|
|
</RecoilRoot>
|
|
|
|
);
|
2022-04-26 13:39:35 -07:00
|
|
|
|
2023-11-07 12:35:05 +09:00
|
|
|
export const LiveDemo = {
|
|
|
|
render: Template,
|
|
|
|
|
|
|
|
args: {
|
|
|
|
online: true,
|
|
|
|
source: 'https://watch.owncast.online/hls/stream.m3u8',
|
|
|
|
title: 'Stream title',
|
|
|
|
},
|
2022-04-26 19:29:13 -07:00
|
|
|
};
|