import React, { useState } from 'react' import { useAppSelector } from '@/app/hooks' import { ConnectionStatusBar } from './ConnectionStatusBar' import { RequestRtpStreamButton } from './RequestRtpStreamButton' import { RequestSpotlightRidButton } from './RequestSpotlightRidButton' import { ResetRtpStreamButton } from './ResetRtpStreamButton' import { ResetSpotlightRidButton } from './ResetSpotlightRidButton' import { Video } from './Video' import { VolumeVisualizer } from './VolumeVisualizer' const VideoBox: React.FC = () => { const [height, setHeight] = useState(0) const audio = useAppSelector((state) => state.audio) const video = useAppSelector((state) => state.video) const audioOutput = useAppSelector((state) => state.audioOutput) const displayResolution = useAppSelector((state) => state.displayResolution) const focusedSpotlightConnectionIds = useAppSelector( (state) => state.focusedSpotlightConnectionIds, ) const connectionId = useAppSelector((state) => state.soraContents.connectionId) const localMediaStream = useAppSelector((state) => state.soraContents.localMediaStream) const micDevice = useAppSelector((state) => state.micDevice) const focused = connectionId && focusedSpotlightConnectionIds[connectionId] if (audio === false && video === false) { return null } return ( <>
) } export const LocalVideo: React.FC = () => { const connectionId = useAppSelector((state) => state.soraContents.connectionId) const clientId = useAppSelector((state) => state.soraContents.clientId) const simulcast = useAppSelector((state) => state.simulcast) const spotlight = useAppSelector((state) => state.spotlight) const role = useAppSelector((state) => state.role) return (
{connectionId !== null || clientId !== null ? (
) : null} {connectionId !== null && spotlight !== 'true' && simulcast == 'true' && role !== 'sendonly' ? (
) : null} {connectionId !== null && spotlight === 'true' ? (
) : null}
{role !== 'recvonly' ? : null}
) }