Skip to content

macOS: audio-only media fails to open ("Failed to retrieve video size") #267

Done

Description

@rocketraman

Description

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

  1. On macOS, create a VideoPlayerState with rememberVideoPlayerState().
  2. Open an audio-only file: state.openUri("/path/to/music.m4a").
  3. 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

  1. rocketraman commented on Nov 9, 2026

    @rocketraman
    Author

    #266 fixes this.

  2. kdroidFilter commented on Dec 2, 2026

    @kdroidFilter
    Owner

    The code of this library now lives in the Nucleus repository (the media modules), see the README and the migration guide. Fixed there: audio-only media plays on every platform, checked by the audio-only conformance scenario.

    If you still see it with Nucleus 3.0, please open an issue in NucleusFramework/Nucleus.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions