Skip to main content

Video Chat Component

The Video Chat component provides real-time audio and video communication between participants in an experiment. As a global component, it can persist across multiple states, enabling continuous interaction throughout the experiment.

Key Features

  • Real-time audio/video communication
  • Configurable layout options (grid, spotlight, etc.)
  • Audio and video controls for participants
  • Role-based permissions
  • Screen sharing capabilities
  • Optional recording functionality
  • Adaptive quality based on network conditions
  • Device selection for camera and microphone

When to Use

Use the Video Chat component when you need to:

  • Enable face-to-face interaction between participants
  • Capture verbal and non-verbal responses
  • Facilitate discussions or interviews
  • Allow experimenter observation or participation
  • Record participant reactions to stimuli
  • Create social presence in remote experiments

Configuration

Basic Settings

SettingDescriptionDefault
Enable AudioAllow audio communicationtrue
Enable VideoAllow video communicationtrue
Initial Audio StateStart with microphones on/offMuted
Initial Video StateStart with cameras on/offOn
Show ControlsDisplay audio/video toggle buttonstrue
Allow Screen SharingEnable screen sharing functionalityfalse
Default LayoutHow participants are displayedGrid
WidthComponent width (px or %)100%
HeightComponent height (px or %)300px
PositionComponent placementTop-right

Layout Options

LayoutDescriptionBest For
GridEqual-sized tiles for all participantsSmall groups (2-4 people)
SpotlightOne large view with smaller thumbnailsPresenter-focused sessions
Active SpeakerAutomatically highlights current speakerDiscussion-based activities
GalleryHorizontally scrolling row of participantsLarger groups
CustomDefine your own layout rulesSpecial requirements

Permissions Settings

SettingDescriptionDefault
Audio ControlWho can toggle their audioAll participants
Video ControlWho can toggle their videoAll participants
Layout ControlWho can change the layoutHost only
Recording ControlWho can start/stop recordingsHost only
Participant RemovalWho can remove participantsHost only

Advanced Settings

SettingDescriptionDefault
Quality SettingsVideo quality presetsBalanced
Bandwidth LimitMaximum bandwidth usageAutomatic
Background BlurEnable background blurringfalse
Noise SuppressionReduce background noiseStandard
Echo CancellationPrevent audio echoEnabled
Show NamesDisplay participant namestrue
Show Mute IndicatorsVisual indicators for mute statustrue

Role-Based Configuration

You can configure different settings for different participant roles:

Role FeatureDescription
VisibilityWhich roles can see the video chat
PermissionsWhat actions each role can perform
Layout ControlWhich roles can change layout
Recording RightsWhich roles can record sessions

For example, you might configure:

  • Observers can see but not be seen
  • Experimenters can manage recordings
  • Specific participants have different default views

Technical Implementation

LiveKit Integration

The Video Chat component uses LiveKit for WebRTC communication:

  • Adaptive Bitrate: Automatically adjusts quality based on network
  • Connection Management: Handles networking, ICE, and TURN servers
  • Track Publishing: Efficiently manages audio/video streams
  • Selective Subscription: Only receives necessary video tracks

Synchronization Features

The component includes synchronization capabilities:

  • Time Synchronization: Aligns timestamps across participants
  • State Synchronization: Maintains consistent audio/video states
  • Layout Synchronization: Optionally keeps layouts consistent

Performance Considerations

Video chat is resource-intensive and depends on:

  • CPU Usage: Video encoding/decoding requires processing power
  • Network Bandwidth: Higher quality requires more bandwidth
  • Memory Usage: Multiple participants increase memory needs

The component automatically adapts to available resources.

Implementation Examples

Basic Discussion Setup

Configuration:
- Default Layout: Grid
- Initial Audio State: Unmuted
- Initial Video State: On
- Show Controls: true
- Position: Top-right
- Height: 30% of window

Experimenter-Participant Interview

Configuration:
- Default Layout: Spotlight
- Auto-Spotlight Role: Experimenter
- Participant Permissions: Toggle own audio/video only
- Experimenter Permissions: Full control
- Recording: Enabled, controlled by Experimenter

Reaction Observation

Configuration:
- Default Layout: Grid
- Initial Audio State: Muted (for participants)
- Initial Video State: On
- Recording: Automatic
- Position: Side panel
- Show stimulus in main area

Best Practices

Technical Setup

  1. Connection Testing: Have participants test their connection before starting
  2. Device Setup: Guide participants to select appropriate cameras and microphones
  3. Background Considerations: Advise on appropriate lighting and backgrounds
  4. Bandwidth Management: Adjust quality settings based on expected connections

Experimental Design

  1. Appropriate Timing: Consider when video chat should be visible/hidden
  2. Clear Instructions: Explain when participants should use audio/video
  3. Privacy Considerations: Inform participants about recording
  4. Backup Plans: Have alternative communication methods ready

User Experience

  1. Positioning: Place video chat where it doesn't obscure focus components
  2. Size Considerations: Balance size for visibility vs. screen space
  3. Control Accessibility: Ensure controls are easy to understand and use
  4. Mobile Compatibility: Test layout on smaller screens

Troubleshooting

Common Issues

IssuePotential Solutions
Camera not workingCheck browser permissions; try a different camera
Audio problemsVerify microphone selection; check system audio settings
Poor video qualityCheck network connection; reduce quality settings
Participants can't see each otherVerify network connectivity; check TURN server configuration
Excessive CPU usageReduce video quality; limit number of visible participants

Technical Diagnostics

The component includes diagnostic tools:

  • Connection Status Indicator: Shows network quality
  • Bandwidth Usage Display: Shows data consumption
  • Error Logging: Captures issues in console logs
  • Media Device Testing: Verifies camera and microphone

Data Collection

The Video Chat component can collect:

  • Participation Metrics: Speaking time, camera-on time
  • Interaction Patterns: Turn-taking, interruptions
  • Technical Metrics: Connection quality, bandwidth usage
  • Full Recordings: Complete audio/video for later analysis

Privacy and Ethical Considerations

When using Video Chat:

  1. Informed Consent: Ensure participants know when they're on camera
  2. Recording Disclosure: Clearly indicate when sessions are recorded
  3. Data Storage: Secure all video recordings appropriately
  4. Data Minimization: Only record what's necessary for research
  5. Participant Control: Give participants control over their audio/video

Integration with Other Components

The Video Chat component works well with:

  • Text Chat: As an alternative/supplementary communication channel
  • Shared Media: For discussing viewed content
  • Collaborative Tasks: For communication during joint activities
  • Rating Components: For evaluating interactions

Alternatives to Consider

  • Text Chat Component: Lower bandwidth, more anonymous
  • Audio-Only Communication: Less intrusive, lower resource usage
  • Pre-recorded Instructions: For one-way communication needs