You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: audio-only media fails to open ("Failed to retrieve video size") #267
On macOS (JVM desktop), media without a video track never plays. Opening an audio-only file such as an .m4a or .mp3 ends with error set to "Failed to retrieve video size", and hasMedia stays false. The same files play on Linux, Windows and the web.
Steps to reproduce
On macOS, create a VideoPlayerState with rememberVideoPlayerState().
Open an audio-only file: state.openUri("/path/to/music.m4a").
Call state.play().
Expected behavior
The audio plays, with duration and currentTime reported as for any other media.
Actual behavior
Nothing plays. The console prints Error loading video tracks: Unknown, and after about five seconds the state's error is "Failed to retrieve video size".
Environment
ComposeMediaPlayer 0.11.4, and the same code on master
macOS, JVM desktop target
Cause
In NativeVideoPlayer.swift, openUri loads the asset's video tracks and returns early when there is none, before setupVideoOutputAndPlayer, so no AVPlayer is ever created. MacVideoPlayerState then polls for a frame size that never comes, and fails the open.
I have a fix that plays such media through an AVPlayer with no video output, and will open a PR for it.
Activity
rocketraman commentedon Nov 9, 2026
#266 fixes this.