Register a video element for mood analysis. Call this when a participant joins or their video becomes available.
The participant's user ID
The HTML video element showing their video
OptionalisLocal: booleanWhether this is the local user's video
Disable mood analysis programmatically.
This allows child components to turn off mood analysis without
needing to control the provider's enabled prop.
Enable mood analysis programmatically.
This allows child components to turn on mood analysis without
needing to control the provider's enabled prop.
Whether mood analysis is currently enabled.
Any error that occurred during initialization.
Get the mood state for a specific participant.
The participant's user ID
The mood state or undefined if not available
Whether the analyzer is currently loading.
Current mood states for all registered participants. Map of userId -> MoodState
Whether the analyzer is ready (loaded and initialized).
Unregister a video element from mood analysis. Call this when a participant leaves or their video is removed.
The participant's user ID to remove
Set the enabled state programmatically.
Whether to enable or disable mood analysis
Context value provided by MoodAnalysisProvider.
Remarks
Access this via the
useMoodAnalysis()hook oruseMoodAnalysisSafe()hook.Ways to Access Mood Data
moodStatesMap - All mood states keyed by userIdgetMoodState(userId)- Get a specific participant's mooduseMoodState(userId)- Hook for a specific user (re-renders on change)Example