Skip to content

Conversation

@YarivHashaiComet
Copy link
Collaborator

@YarivHashaiComet YarivHashaiComet commented Dec 7, 2025

Details

This PR fixes video thumbnails not displaying in the playground dataset table when using cross-origin video URLs (e.g., S3 URLs).

Root Cause

The VideoThumbnail component was attempting to use HTML5 canvas to extract video frames for thumbnail generation. This fails for cross-origin videos due to CORS restrictions - browsers block pixel-level access to cross-origin media when using canvas (known as "tainted canvas").

Solution

For cross-origin videos, the component now:

  1. Detects if the video URL is cross-origin using the isCrossOrigin() helper
  2. Skips canvas-based thumbnail generation entirely
  3. Uses ReactPlayer directly to display the video, which can play cross-origin videos without needing pixel access

For same-origin videos, the existing optimized canvas-based thumbnail generation continues to work.

Benefits

  • ✅ Video thumbnails now display properly for cross-origin URLs
  • ✅ No more CORS errors in the console
  • ✅ Better performance - skips failed thumbnail generation attempts
  • ✅ Works in playground dataset tables, tooltips, and fullscreen dialogs

Change checklist

  • User facing
  • Documentation update

Issues

  • OPIK-3385

Testing

Tested with S3 video URLs in the playground:

  1. Load dataset with video URLs in playground
  2. Video thumbnails display correctly in the dataset table
  3. Clicking on videos opens fullscreen player
  4. No CORS errors in console

Documentation

N/A

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

📋 PR Linter Failed

Missing Section. The description is missing the ## Documentation section.

@YarivHashaiComet YarivHashaiComet marked this pull request as ready for review December 7, 2025 12:56
@YarivHashaiComet YarivHashaiComet requested a review from a team as a code owner December 7, 2025 12:56
@YarivHashaiComet YarivHashaiComet added the test-environment Deploy Opik adhoc environment label Dec 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

🔄 Test environment deployment started

Building images for PR #4374...

You can monitor the build progress here.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

Copy link
Contributor

@awkoy awkoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@YarivHashaiComet YarivHashaiComet merged commit 1a05667 into main Dec 9, 2025
28 checks passed
@YarivHashaiComet YarivHashaiComet deleted the yariv-h/OPIK-3385-video-previews-not-loading-in-playground branch December 9, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend test-environment Deploy Opik adhoc environment typescript *.ts *.tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants