Skip to content

Commit

Permalink
Remove hardcoded video name
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Dec 11, 2024
1 parent cafd3bb commit e2a2a59
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const FullScreenCard = styled.div`

interface IFullScreenVideoStreamCardProps {
videoStream: MediaStream
videoStreamName: string
videoStreamName?: string
toggleFullScreenMode: VoidFunction
}

Expand All @@ -56,8 +56,8 @@ export const FullScreenVideoStreamCard = ({
// Rotated stream is not supported for simpleplayer
return (
<FullScreenCard>
<Typography variant="h5">{videoStreamName}</Typography>
<VideoPlayerSimpleStream videoStream={videoStream} videoStreamName={videoStreamName} />
{videoStreamName && <Typography variant="h5">{videoStreamName}</Typography>}
<VideoPlayerSimpleStream videoStream={videoStream} />
{fullScreenExitButton(false)}
</FullScreenCard>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
interface IVideoPlayerProps {
videoStream: MediaStream
videoStreamName: string
}

export const VideoPlayerSimpleStream = ({ videoStream, videoStreamName }: IVideoPlayerProps) => (
export const VideoPlayerSimpleStream = ({ videoStream }: { videoStream: MediaStream }) => (
<video
autoPlay
muted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const StyledVideoSection = styled.div`

interface IVideoStreamCardProps {
videoStream: MediaStream
videoStreamName: string
videoStreamName?: string
toggleFullScreenMode: VoidFunction
setFullScreenStream: Function
}
Expand All @@ -49,11 +49,11 @@ export const VideoStreamCard = ({
<VideoCard style={{ boxShadow: tokens.elevation.raised }}>
<div onDoubleClick={turnOnFullScreen}>
<StyledVideoSection>
<VideoPlayerSimpleStream videoStream={videoStream} videoStreamName={videoStreamName} />
<VideoPlayerSimpleStream videoStream={videoStream} />
{fullScreenButton}
</StyledVideoSection>
</div>
<Typography variant="h5">{videoStreamName}</Typography>
{videoStreamName && <Typography variant="h5">{videoStreamName}</Typography>}
</VideoCard>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ export const VideoStreamWindow = ({ videoStreams }: VideoStreamWindowProps) => {
toggleFullScreenMode()
}

const videoStreamName = 'video' // TODO: decide if we want a name for it

const videoCards = videoStreams.map((videoStream, index) => (
<VideoStreamCard
key={index}
videoStream={new MediaStream([videoStream])}
videoStreamName={videoStreamName}
videoStreamName={undefined}
toggleFullScreenMode={toggleFullScreenMode}
setFullScreenStream={updateFullScreenStream}
/>
Expand All @@ -64,7 +62,7 @@ export const VideoStreamWindow = ({ videoStreams }: VideoStreamWindowProps) => {
<VideoFullScreen isOpen={fullScreenMode} onRequestClose={toggleFullScreenMode}>
<FullScreenVideoStreamCard
videoStream={videoStream}
videoStreamName={videoStreamName}
videoStreamName={undefined}
toggleFullScreenMode={toggleFullScreenMode}
/>
</VideoFullScreen>
Expand Down

0 comments on commit e2a2a59

Please sign in to comment.