2022-04-26 23:39:35 +03:00
|
|
|
import React from 'react';
|
|
|
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
2022-05-26 06:38:40 +03:00
|
|
|
import { RecoilRoot } from 'recoil';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { OwncastPlayer } from './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
|
|
|
|
2022-05-26 06:38:40 +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',
|
2023-01-24 06:28:32 +03:00
|
|
|
title: 'Stream title',
|
2022-04-27 05:29:13 +03:00
|
|
|
};
|