In unity webGL, how can i know a room is being rec...
# ask-ai
c
In unity webGL, how can i know a room is being recorded
t
Thanks for reaching out, Cao. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
In a Unity WebGL application, you can determine if a LiveKit room is being recorded by interacting with the LiveKit JavaScript client SDK. Here are the main approaches: • Check the room's
isRecording
property:
The
Room
object has an
isRecording
property that returns
true
if the room is currently being recorded.
const isCurrentlyRecording = room.isRecording;
• Listen for recording status changes: You can subscribe to the
RecordingStatusChanged
event to get real-time updates when recording starts or stops.
Copy code
room.on(RoomEvent.RecordingStatusChanged, (isRecording) => {
  // Handle status change
});
• Use the observable pattern (if using LiveKit Components): The
recordingStatusObservable(room)
function provides a stream of recording status changes.
Copy code
const recordingObservable = recordingStatusObservable(room);
recordingObservable.subscribe(isRecording => {
  // Handle status change
});
These methods allow your Unity WebGL client to detect and respond to recording status in real time. Sources: src/room/events.ts | packages/core/src/observables/room.ts
c
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
c
Livekit check if room is being record in unity