Skip to content

fix(macos): play audio-only media instead of failing with "Failed to … - #266

Open
muthuraj57 wants to merge 2 commits into
kdroidFilter:masterfrom
muthuraj57:macos-audio-only
Open

muthuraj57 wants to merge 2 commits into
kdroidFilter:masterfrom
muthuraj57:macos-audio-only

Conversation

@muthuraj57

Copy link
Copy Markdown

play audio-only media instead of failing with "Failed to retrieve video size"

The macOS player required a video size after opening, so an mp3 or m4a (no video track) always failed. Media with no video size but an audio track or a finite duration now plays as audio-only: playback, pause, seek, position and end-of-playback work as before, with no frames. The dimension poll stops early (after 2 s) once the asset reports an audio track; a late video size is still picked up by the frame pipeline, which keeps reading. Matches the Windows and Linux audio-only handling.

…retrieve video size"

The macOS player required a video size after opening, so an mp3 or m4a (no video track) always
failed. Media with no video size but an audio track or a finite duration now plays as audio-only:
playback, pause, seek, position and end-of-playback work as before, with no frames. The dimension
poll stops early (after 2 s) once the asset reports an audio track; a late video size is still
picked up by the frame pipeline, which keeps reading. Matches the Windows and Linux audio-only
handling.
openUri only set up the AVPlayer once a video track loaded, so an audio-only file (mp3, m4a) never got a
player: it stayed at 0:00 with no duration. With no video track and no load error, the native player now
plays it as audio-only, without an AVPlayerItemVideoOutput.

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.

2 participants