Skip to content

Load the video player with the first video slide - #59

Merged
dhh merged 1 commit into
masterfrom
lazy-video-player
Nov 12, 2026
Merged

dhh merged 1 commit into
masterfrom
lazy-video-player

Conversation

@dhh

@dhh dhh commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Hype took about 2.2 seconds to open its window on an NVIDIA GB10, whatever the deck held. Nearly all of it was engine.load(Main.qml) creating the MediaPlayer, AudioOutput, and VideoOutput: any one of them starts Qt Multimedia's FFmpeg backend, which calls av_hwdevice_ctx_create (vkCreateDevice, cuInit) on the GUI thread to probe hardware decoders.

The player and its output now live in a Loader that turns on the first time a video slide is selected and stays on. Decks without video never start the backend, and decks with video keep hardware decoding (turning the probe off with QT_FFMPEG_DECODING_HW_DEVICE_TYPES would also have removed the delay, but at that cost). The window now opens in about 0.4 seconds.

This is the same trap other Omarchy apps have hit, so the omarchy-app skill gets a rule about it too.

🤖 Generated with Claude Code

Creating a MediaPlayer, AudioOutput, or VideoOutput starts Qt Multimedia's
FFmpeg backend, which probes the GPU's hardware decoders on the GUI thread.
On an NVIDIA GB10 that added about two seconds to every launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Defers creating the video player until a video slide is first selected.

  • The video player loads when a deck first selects a video slide.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Window opens or slide changes] --> B{Selected slide has video?}
    B -->|First video| C[Activate video loader]
    C --> D[Create player and outputs]
    B -->|No video or already loaded| E{Player exists?}
    D --> E
    E -->|No| F[Leave player unloaded]
    E -->|Yes| G[Sync source when needed]
    G --> H{Presenting with autoplay?}
    H -->|Yes| I[Play video]
    H -->|No| J[Wait for playback control]
Loading

Reviews (1) · Last reviewed commit: "Load the video player with the first vid..." · Reviewed by Greptile

@dhh
dhh merged commit 4fd6a0d into master Nov 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant