Repository navigation
fix(macos): play audio-only media instead of failing with "Failed to … - #266
Open
muthuraj57 wants to merge 2 commits into
Open
muthuraj57 wants to merge 2 commits into
muthuraj57 wants to merge 2 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.