Skip to content

Instantly share code, notes, and snippets.

@JonnyBurger
Created February 18, 2026 15:37
Show Gist options
  • Select an option

  • Save JonnyBurger/9e5edef1566db03ec745e2385e703eb8 to your computer and use it in GitHub Desktop.

Select an option

Save JonnyBurger/9e5edef1566db03ec745e2385e703eb8 to your computer and use it in GitHub Desktop.
AI-generated docs draft: Loop support varies based on video component rendering.

empz3190 - 2/18/2026, 1:31:54 PM

Question about the new Video component and its fallback to OffthreadVideo behavior.

I see there's a fallbackOffthreadVideoPropsprop on the Video component.

The question is, what happens with "loop"? The new Video component supports the loop property, but OffthreadVideo does not. So what would happen if, during rendering, the component needs to fallback to OffthreadVideo and it was set to loop? It certainly won't loop, right? Anyway to resolve this inconsistency?

jonnyburger - 2/18/2026, 3:20:56 PM

the answer is that during preview, it works because it falls back to Html5Video which supports loop. during rendering, it depends:

  • most of the times we can get the duration from the container, even if the codec is not supported. We will automatically wrap OffthreadVideo in the appropriate <Loop>
  • if the container is broken, or there is a CORS/network issue, we cannot get the duration and we fail.

so if you guard against CORS issues and invalid files, it should properly loop also in the fallbacl

will make sure to document this better!

Technical Note: Video Component Loop Behavior and OffthreadVideo Fallback

Problem

The new Video component supports a loop property, while the OffthreadVideo component does not. This raises concerns regarding the behavior when the Video component falls back to OffthreadVideo during rendering while the loop property is set.

Reasons

  1. During preview, the fallback to Html5Video allows for loop functionality.
  2. During rendering, fallback to OffthreadVideo can occur if:
    • The codec is unsupported.
    • There is a broken container or CORS/network issues, which prevent obtaining the necessary video duration.

Solution

To ensure that looping behaves correctly during fallback:

  • Safeguard against CORS issues and invalid video files.
  • If the container is intact, we can typically retrieve the video duration, allowing us to wrap OffthreadVideo in a <Loop> component.
  • In scenarios where issues arise in retrieving the duration, the loop functionality may fail.

By implementing these precautions, the looping functionality should operate properly even during fallback scenarios. We will improve the documentation around this behavior for clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment