* WIP add recording support * Add region env var * Add recording indicator * Indicator and support for stopping recording * remove logs * rename server functions
31 lines
736 B
TypeScript
31 lines
736 B
TypeScript
import { useIsRecording } from '@livekit/components-react';
|
|
import * as React from 'react';
|
|
|
|
export function RecordingIndicator() {
|
|
const isRecording = useIsRecording();
|
|
const [wasRecording, setWasRecording] = React.useState(false);
|
|
|
|
React.useEffect(() => {
|
|
if (isRecording !== wasRecording) {
|
|
setWasRecording(isRecording);
|
|
if (isRecording) {
|
|
window.alert('This meeting is being recorded');
|
|
}
|
|
}
|
|
}, [isRecording]);
|
|
|
|
return (
|
|
<div
|
|
style={{
|
|
position: 'absolute',
|
|
top: '0',
|
|
left: '0',
|
|
width: '100%',
|
|
height: '100%',
|
|
boxShadow: isRecording ? 'red 0px 0px 0px 3px inset' : 'none',
|
|
pointerEvents: 'none',
|
|
}}
|
|
></div>
|
|
);
|
|
}
|