Repository navigation
feat(desktop): expose whether the first frame has been rendered - #263
Open
comprido96 wants to merge 1 commit into
Open
comprido96 wants to merge 1 commit into
comprido96 wants to merge 1 commit into
Conversation
A caller that shows a loader or a placeholder over the video needs to know when there is a picture to show. isLoading is not that signal (it is forced off after three seconds without frames, and it covers seeks), and the decoded frame itself (currentFrameState) is internal. Add VideoPlayerState.hasRenderedFirstFrame: false after openUri/openFile until a frame of the new media has been handed to the surface. macOS and Windows derive it from currentFrameState, which every open clears; Linux keeps the last frame on the surface across an open, so it tracks the flag on its own. Other platforms report false for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
A UI that keeps a loader or a placeholder over the video needs to know when the first frame of a media is on screen.
isLoadingis not that signal: it is forced to false after three seconds without frames, and it also covers seeks. The decoded frame (currentFrameState) is internal.Change
VideoPlayerState.hasRenderedFirstFrame: false afteropenUri/openFileuntil a frame of the new media has been handed to the surface. Snapshot-observable.currentFrameState, which every open clears (releaseAllResources).openUriand set by the first non-null frame.false, so Android, iOS and web report false for now. I can extend it to those platforms if you prefer it there before merging.Testing
:mediaplayer:compileKotlinJvmpasses. Android and the other targets only see the interface default.currentFrameState") drove the loader of a desktop app during integration.Prepared with an AI coding assistant (Claude Code) while integrating the library into a macOS desktop app, and tested as described above. Happy to adjust, split or drop anything that does not fit the project.
🤖 Generated with Claude Code