-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { UserStatus } from "../../store/atom" | ||
|
||
export default function Detail(props: { streamId: string, userStatus: UserStatus, restart: () => void }) { | ||
const { streamId, userStatus, restart } = props | ||
return ( | ||
<details className='text-white mx-2 text-sm font-border' style={{ position: 'absolute' }}> | ||
<summary className='text-center'>{userStatus.name}</summary> | ||
<center> | ||
<div className='flex flex-row flex-wrap justify-around'> | ||
<p>name: <code>{userStatus.name}</code></p> | ||
<p>state: <code>{String(userStatus.state)}</code></p> | ||
</div> | ||
<div className='flex flex-row flex-wrap justify-around'> | ||
<p>audio: <code>{String(userStatus.audio)}</code></p> | ||
<p>video: <code>{String(userStatus.video)}</code></p> | ||
<p>screen: <code>{String(userStatus.screen)}</code></p> | ||
</div> | ||
<code>{streamId}</code> | ||
</center> | ||
|
||
<center className='text-white flex flex-row justify-around'> | ||
<p className='rounded-xl p-2 b-1 hover:border-orange-300'>{userStatus.state}</p> | ||
<button className='btn-primary' onClick={restart}>restart</button> | ||
</center> | ||
</details> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,13 @@ | ||
import useWhipClient from "../use/whip" | ||
import Detail from './detail' | ||
import Player from './player' | ||
|
||
export default function WhipPlayer(props: { streamId: string, width: string }) { | ||
const { stream, userStatus, restart } = useWhipClient(props.streamId) | ||
return ( | ||
<div className='flex flex-col'> | ||
<center> | ||
<Player stream={stream} muted={true} width={props.width} display="auto" /> | ||
</center> | ||
|
||
<details className='text-white mx-2 text-sm font-border' style={{ | ||
position: 'absolute', | ||
}}> | ||
<summary className='text-center'>{userStatus.name}</summary> | ||
<center> | ||
<div className='flex flex-row flex-wrap justify-around'> | ||
<p>name: <code>{userStatus.name}</code></p> | ||
<p>state: <code>{String(userStatus.state)}</code></p> | ||
</div> | ||
<div className='flex flex-row flex-wrap justify-around'> | ||
<p>audio: <code>{String(userStatus.audio)}</code></p> | ||
<p>video: <code>{String(userStatus.video)}</code></p> | ||
<p>screen: <code>{String(userStatus.screen)}</code></p> | ||
</div> | ||
|
||
<code>{props.streamId}</code> | ||
</center> | ||
|
||
<center className='text-white flex flex-row justify-around'> | ||
<p className='rounded-xl p-2 b-1 hover:border-orange-300'>{userStatus.state}</p> | ||
<button className='btn-primary' onClick={() => restart()}>restart</button> | ||
</center> | ||
</details> | ||
</div> | ||
<center className='flex flex-col'> | ||
<Player stream={stream} muted={true} width={props.width} display="auto" /> | ||
<Detail streamId={props.streamId} userStatus={userStatus} restart={restart} /> | ||
</center> | ||
) | ||
} |