Skip to content

feat: configure macOS video dimensions timeout - #252

Open
itboy87 wants to merge 1 commit into
kdroidFilter:masterfrom
itboy87:codex/configurable-macos-metadata-timeout
Open

itboy87 wants to merge 1 commit into
kdroidFilter:masterfrom
itboy87:codex/configurable-macos-metadata-timeout

Conversation

@itboy87

@itboy87 itboy87 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

macOS currently polls AVFoundation for video dimensions for five seconds. Valid remote media whose dimensions arrive later cannot opt into a longer window and may report Failed to retrieve video size.

This adds a positive, configurable dimension-polling timeout while retaining the existing 5,000 ms default, 250 ms polling cadence, duration polling, and initialization timeout. Desktop callers can use:

val playerState = rememberVideoPlayerState(macVideoDimensionsTimeoutMillis = 30_000L)

The setting is also available through DefaultVideoPlayerState(macVideoDimensionsTimeoutMillis = ...) and MacVideoPlayerState(videoDimensionsTimeoutMillis = ...). Existing no-argument constructors remain available. The desktop Compose overload disposes its state when removed or when the configured value changes; Windows and Linux retain their existing playback behavior.

Longer dimension polling stops when an open is superseded or the player is disposed. A superseded open cannot clear the current open's loading state.

Validation:

  • Local JVM compilation and the full JVM suite passed: 76 tests passed, five skipped, no failures.
  • Unit coverage verifies the unchanged five-second window and 20 reads, longer and shorter deadlines, positive dimensions, cancellation, superseded opens, invalid values, and no-argument constructors.
  • Real AVFoundation tests use a synthetic MP4 behind a local HTTP server that delays responses by 16 seconds. The default still rejects the source; an explicit 30-second timeout plays both an MP4 URI and an opaque URI without reopening.
  • A macOS CI job builds the JVM library and runs these unit and native integration tests with freshly built native binaries.

This branch has not been deployed

No deployments
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