Skip to main content

Synchronized Video Component

The Synchronized Video component allows you to present video content precisely synchronized across all participants. It's one of the core features of the HyperStudy platform, enabling experiments where participants view the same media with millisecond-level synchronization.

Usage Scenarios

  • Showing stimulus videos to multiple participants simultaneously
  • Social viewing experiments where participant reactions are recorded
  • Media co-consumption studies
  • Measuring physiological responses to synchronized video content

Configuration Options

ParameterDescriptionDefault
videoSourceURL or file ID of the video to display(required)
autoPlayAutomatically start video when component loads (host only)*false
showControlsDisplay video playback controlstrue
showTimecodeDisplay current time positionfalse
syncAccuracyTarget synchronization accuracy in milliseconds50
hostControlOnlyOnly allow the host role to control playbacktrue
allowSkippingAllow seeking through the videotrue
startTimeInitial playback position in seconds0
endTimeIf set, video will automatically proceed to next state at this time(optional)
widthWidth of the video player (px or %)100%
heightHeight of the video player (px or %)auto
skipOnCompleteAutomatically advance to next state when video completesfalse

Autoplay Browser Policies

Important: Modern browsers have strict autoplay policies. Videos with sound may not autoplay automatically, especially:

  • On the first visit to your experiment
  • Without prior user interaction
  • In certain browsers (Firefox, Safari)

If autoplay is blocked, the host participant will need to manually click the play button to start the video. This is a browser security feature and cannot be bypassed without compromising experiment integrity.

Host Controls

When hostControlOnly is enabled (default), only the participant assigned to the "host" role can control video playback. All other participants will be synchronized to the host's playback position. Host controls include:

  • Play/pause
  • Seeking to specific positions
  • Adjusting playback rate
  • Emergency resynchronization

Synchronization Technology

The component uses a sophisticated synchronization system:

  • Kalman Filter: Predicts host position accounting for network latency
  • PID Controller: Adjusts playback rates to maintain synchronization
  • Server-mediated Time: Shares a common time reference across all clients
  • Adaptive Buffering: Handles client buffering events intelligently

Adding a Synchronized Video

  1. In the Experiment Designer, select the state where you want to add the video
  2. Set the focus component to "Synchronized Video"
  3. Configure the video options:
    • Select a video from the media library or provide a URL
    • Set playback options
    • Configure synchronization parameters
  4. Save your changes

Video Sources

The Synchronized Video component supports two types of video sources:

Videos uploaded to HyperStudy's media library:

  • Security: Protected by signed URLs (not publicly accessible)
  • Performance: Automatically precached for instant playback
  • Synchronization: Optimized for precise multi-participant sync
  • Privacy: URLs expire after 3 hours, preventing unauthorized access
  • Best For: Proprietary content, sensitive materials, research videos

External Videos

Videos hosted on external platforms:

  • Flexibility: Use videos from YouTube, Vimeo, university servers, CDNs
  • No Upload: Link directly to publicly accessible URLs
  • Requirement: Must be publicly accessible
  • Best For: Public educational content, videos already hosted elsewhere
  • Note: No access control or signed URL protection

Video File Requirements

Critical: Format Compatibility

Some video formats will cause playback failures in Firefox, particularly when using timestamp-based features like Sparse Rating or multi-state experiments with time segmentation. Always use MP4 (H.264, yuv420p chroma) for maximum compatibility.

See the Video Format Recommendations section in the Media Management guide for detailed compatibility information.

MP4 with specific encoding:

  • Video codec: H.264 (x264)
  • Audio codec: AAC
  • Chroma subsampling: yuv420p (Firefox requires this)
  • Container optimization: faststart flag enabled
  • Resolution: 720p or 1080p recommended (higher resolutions increase bandwidth)
  • Duration: Videos under 20 minutes perform best
  • File size: Keep under 200MB when possible for faster precaching
  • Hosting: Use the built-in media library for best performance and security

Alternative format:

  • WebM (VP8/VP9 video, Vorbis/Opus audio) - Full browser support

Problematic Formats ⚠️

The following formats may cause Firefox playback failures, especially when:

  • Using Sparse Rating component (pause/resume at timestamps)
  • Jumping to specific timestamps (startTime/endTime state parameters)
  • Segmenting videos across multiple states

Formats to avoid:

  • MOV (QuickTime) - Firefox often fails with "corrupt file" error due to chroma subsampling incompatibility
  • AVI - No browser support
  • ⚠️ MKV - Very limited browser support
  • ⚠️ M4V - May have same issues as MOV

What happens with incompatible formats:

  • Video may play initially but crash when seeking/pausing
  • State transitions may fail with decode errors
  • Sparse rating pause/resume may cause video to freeze
  • Works fine in Chrome/Safari but fails in Firefox

Solution: Convert problematic formats to MP4 using FFmpeg:

ffmpeg -i input.mov -c:v libx264 -pix_fmt yuv420p -preset medium -crf 23 \
-c:a aac -b:a 128k -movflags +faststart output.mp4

For detailed information about format compatibility issues and conversion, see the Media Management guide.

Advanced Features

Automatic Media Precaching

The platform automatically precaches videos before the experiment starts to ensure optimal performance:

How It Works:

  1. Videos are identified during experiment initialization
  2. All participants preload videos before entering video states
  3. Playback starts instantly without buffering delays
  4. Browser caching optimized for efficient re-use

Benefits:

  • Instant Playback: No loading delays when video state begins
  • Perfect Synchronization: All participants start from fully loaded state
  • Consistent Timing: Eliminates network-dependent loading variability
  • Improved UX: Smooth, professional experiment experience

What Gets Precached:

  • All videos used in Video components throughout the experiment
  • Both platform-hosted and external videos (when possible)
  • Images used in Image components

Best Practice: Upload videos to the platform's media library for optimal precaching support. External videos may have variable precaching success depending on CORS policies and hosting configuration.

Synchronization Quality Indicator

Enable the showSyncIndicator option to display a small indicator showing current synchronization quality. Colors represent:

  • Green: Excellent synchronization (within 50ms)
  • Yellow: Acceptable synchronization (50-200ms)
  • Red: Poor synchronization (>200ms)

Variable Capture

Set the capturePositionToVariable option to store the current playback position to a specified variable at regular intervals or when playback stops.

Time-based Events

Use the timeEvents array to trigger events or set variables at specific timestamps during playback:

"timeEvents": [
{
"time": 45.5,
"action": "setVariable",
"variable": "exposureComplete",
"value": true
},
{
"time": 120,
"action": "showOverlay",
"content": "Pay attention to the next section"
}
]

Best Practices

  1. Use Platform-Hosted Videos: Upload videos to the media library for best security, performance, and precaching support
  2. Test Across Devices: Video performance can vary - test on comparable devices to what participants will use
  3. Keep Videos Short: Long videos increase the chance of synchronization issues
  4. Secure Sensitive Content: For proprietary or sensitive materials, always upload to the platform rather than using external URLs
  5. External Videos: When using external videos, ensure they are:
    • Publicly accessible (no authentication required)
    • Hosted on reliable, fast servers
    • Direct MP4 links rather than service URLs when possible
  6. Monitor Precaching: During testing, check console logs to confirm videos precache successfully before experiment starts
  7. Consider File Size: Larger videos take longer to precache - balance quality with loading time

Common Issues and Solutions

IssuePossible CauseSolution
"Video can't be played because file is corrupt" (Firefox)MOV/AVI/MKV format with incompatible encodingConvert to MP4 with yuv420p chroma (see format guide above)
Sparse rating fails/freezesIncompatible video format (MOV)Use MP4 (H.264, yuv420p) instead
State transitions fail with decode errorMOV file with yuv422p/yuv444p chromaConvert to MP4 with -pix_fmt yuv420p
Video won't loadExternal URL not publicly accessibleUpload to platform or use a public URL
Video won't synchronizeNetwork latency variationIncrease buffer time, reduce video quality
Black screen on some devicesCodec compatibilityConvert video to H.264 MP4 with yuv420p
Frequent bufferingBandwidth limitationsReduce video resolution or bitrate
Long loading delayVideo not precachedUpload to platform for automatic precaching
"Access Denied" errorExternal URL requires authenticationUse publicly accessible URL or upload to platform
Audio/video out of syncProcessing limitationsUse lower resolution video, close other applications
Seek controls don't workallowSkipping disabledEnable this setting if seeking is required
Inconsistent performanceUsing external URLUpload to platform for consistent performance
Works in Chrome but not FirefoxVideo encoding incompatibilityEnsure yuv420p chroma subsampling (not yuv422p/yuv444p)