import { Meta, Story } from '@storybook/react'; import React, { useRef } from 'react'; import { VideoList, VideoListProps } from '.'; import { getVideoTileLabel } from '../../utils'; import { VideoTileControls } from '../VideoTile/Controls'; import { MicOffIcon, MicOnIcon } from '../Icons'; import { HMSThemeProvider } from '../../hooks/HMSThemeProvider'; import { HMSPeer, HMSTrack } from '../../store/schema'; import { storyBookSDK } from '../../storybook/store/SetUpFakeStore'; const meta: Meta = { title: 'Video/ List', component: VideoList, argTypes: { maxTileCount: { control: { type: 'range' } }, maxRowCount: { control: { type: 'range' } }, maxColCount: { control: { type: 'range' } }, videoTileControls: { control: { disable: true } }, width: { control: false }, height: { control: { disable: true } }, }, parameters: { controls: { sort: 'requiredFirst' } }, }; export default meta; interface VideoListStoryProps extends VideoListProps { width?: string; height?: string; } const Template: Story = args => { const dummyCameraVideoRef = useRef(null); const dummyScreenVideoRef = useRef(null); return (
); }; export const DefaultList = Template.bind({}); DefaultList.args = { maxTileCount: 3, height: '98vh', width: '100%', classes: { //videoTileRoot: 'p-1', video: 'rounded-lg shadow-lg', }, }; export const CenterStage = Template.bind({}); CenterStage.args = { maxTileCount: 2, overflow: 'hidden', audioLevelDisplayType: 'border', height: '98vh', width: '100%', classes: { videoTile: 'p-2', video: 'rounded-lg shadow-lg', }, }; export const Campfire = Template.bind({}); Campfire.args = { maxTileCount: 5, showAudioLevel: false, displayShape: 'circle', height: '200px', width: '100%', classes: { videoTile: 'p-2', video: 'rounded-lg shadow-lg', root: 'bg-gray-100 rounded-lg', }, showAudioMuteStatus: false, }; export const SideBar = Template.bind({}); SideBar.args = { showAudioLevel: false, classes: { videoTile: 'p-1', video: 'rounded-lg shadow-lg', }, }; const GoogleMeetControls = ({ allowRemoteMute, isAudioMuted, peer, showAudioLevel, showAudioMuteStatus, audioLevel, hmsVideoTrack, }: { allowRemoteMute: boolean; isAudioMuted?: boolean; peer: HMSPeer; showAudioLevel: boolean; showAudioMuteStatus: boolean; audioLevel?: number; hmsVideoTrack?: HMSTrack; }) => { return ( <> {allowRemoteMute && (
{isAudioMuted ? : }
)} ; ); }; const MeetTemplate: Story = ( args: VideoListStoryProps, ) => { const peers = storyBookSDK.getPeers(); return (
{ ( ))} /> }
); }; export const GoogleMeet = MeetTemplate.bind({}); GoogleMeet.args = { maxTileCount: 6, overflow: 'hidden', aspectRatio: { width: 16, height: 9 }, displayShape: 'rectangle', showAudioLevel: true, audioLevelDisplayType: 'inline-wave', allowRemoteMute: false, height: '100vh', width: '100%', showAudioMuteStatus: true, };