mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-27 20:29:09 +00:00
🚧(frontend) show recording status indicator
Room recording status triggers only when the egress worker is active. Querying the Egress API starts the worker, which joins the room as an invisible participant. The room is marked as "recording" only once the worker has fully joined. Not mergeable yet. Sadly the room event gives no information about the Egress worker’s ID.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { useRoomContext } from '@livekit/components-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { RoomEvent } from 'livekit-client'
|
||||
|
||||
export const RecordingIndicator = () => {
|
||||
const room = useRoomContext()
|
||||
const [isRecording, setIsRecording] = useState(room.isRecording)
|
||||
|
||||
useEffect(() => {
|
||||
const handleRecordingStatusChanges = (isRecording: boolean) => {
|
||||
setIsRecording(isRecording)
|
||||
}
|
||||
room.on(RoomEvent.RecordingStatusChanged, handleRecordingStatusChanges)
|
||||
return () => {
|
||||
room.off(RoomEvent.RecordingStatusChanged, handleRecordingStatusChanges)
|
||||
}
|
||||
}, [room])
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
flexDirection: 'column',
|
||||
width: '100%',
|
||||
}}
|
||||
>
|
||||
Room is recording: {isRecording ? 'yes' : 'no'}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import { participantsStore } from '@/stores/participants'
|
||||
import { FocusLayout } from '../components/FocusLayout'
|
||||
import { ParticipantTile } from '../components/ParticipantTile'
|
||||
import { MainNotificationToast } from '@/features/notifications/MainNotificationToast'
|
||||
import { RecordingIndicator } from '@/features/rooms/livekit/components/RecordingIndicator.tsx'
|
||||
|
||||
const LayoutWrapper = styled(
|
||||
'div',
|
||||
@@ -184,6 +185,7 @@ export function VideoConference({
|
||||
onWidgetChange={widgetUpdate}
|
||||
>
|
||||
<div className="lk-video-conference-inner">
|
||||
<RecordingIndicator />
|
||||
<LayoutWrapper>
|
||||
<div
|
||||
style={{ display: 'flex', position: 'relative', width: '100%' }}
|
||||
|
||||
Reference in New Issue
Block a user