From 4f06985c522198e76a7901dd953b613e25773b01 Mon Sep 17 00:00:00 2001 From: a-wing <1@233.email> Date: Tue, 19 Dec 2023 22:47:14 +0800 Subject: [PATCH] refactor(webapp): show audio && details --- webapp/components/player/player.tsx | 7 +++-- webapp/components/player/whep-player.tsx | 33 ++++++++++++---------- webapp/components/player/whip-player.tsx | 35 +++++++++++++----------- webapp/components/prepare.tsx | 2 +- 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/webapp/components/player/player.tsx b/webapp/components/player/player.tsx index bf97201..ccea3d0 100644 --- a/webapp/components/player/player.tsx +++ b/webapp/components/player/player.tsx @@ -4,7 +4,7 @@ import WaveSurfer from 'wavesurfer.js' import RecordPlugin from 'wavesurfer.js/dist/plugins/record' import { isWechat } from '../../lib/util' -export default function Player(props: { user: UserStream, muted: boolean, width: string }) { +export default function Player(props: { user: UserStream, muted: boolean, width: string, display: string }) { const refVideo = useRef(null) const refWave = useRef(null) @@ -54,7 +54,10 @@ export default function Player(props: { user: UserStream, muted: boolean, width: ref={refVideo} style={!!props.user.stream?.getVideoTracks().length ? { width: props.width } : { height: '0px' }} /> -
+ {props.display === "full" + ?
+ : null + } ) } diff --git a/webapp/components/player/whep-player.tsx b/webapp/components/player/whep-player.tsx index 592e41e..f6b1bcb 100644 --- a/webapp/components/player/whep-player.tsx +++ b/webapp/components/player/whep-player.tsx @@ -61,22 +61,27 @@ export default function WhepPlayer(props: { streamId: string, status: UserStatus return (
- + -
-

name: {props.status.name}

-

state: {String(props.status.state)}

-
-

audio: {String(props.status.audio)}

-

video: {String(props.status.video)}

-

screen: {String(props.status.screen)}

-
-
+
+ {props.status.name} +
+
+

name: {props.status.name}

+

state: {String(props.status.state)}

+
+
+

audio: {String(props.status.audio)}

+

video: {String(props.status.video)}

+

screen: {String(props.status.screen)}

+
+
-
-

{connectionState}

- -
+
+

{connectionState}

+ +
+
) } diff --git a/webapp/components/player/whip-player.tsx b/webapp/components/player/whip-player.tsx index d65699e..e40119b 100644 --- a/webapp/components/player/whip-player.tsx +++ b/webapp/components/player/whip-player.tsx @@ -121,24 +121,27 @@ export default function WhipPlayer(props: { streamId: string, width: string }) { return (
- + -
-
-

name: {localUserStatus.name}

-

state: {String(localUserStatus.state)}

-
-
-

audio: {String(localUserStatus.audio)}

-

video: {String(localUserStatus.video)}

-

screen: {String(localUserStatus.screen)}

-
-
+
+ {localUserStatus.name} +
+
+

name: {localUserStatus.name}

+

state: {String(localUserStatus.state)}

+
+
+

audio: {String(localUserStatus.audio)}

+

video: {String(localUserStatus.video)}

+

screen: {String(localUserStatus.screen)}

+
+
-
-

{localUserStatus.state}

- -
+
+

{localUserStatus.state}

+ +
+
) } diff --git a/webapp/components/prepare.tsx b/webapp/components/prepare.tsx index 9e14269..398a4b6 100644 --- a/webapp/components/prepare.tsx +++ b/webapp/components/prepare.tsx @@ -68,7 +68,7 @@ export default function Prepare(props: { meetingId: string }) { return (
- +