Add FVPController class with working appendBuffer support#342
Draft
Add FVPController class with working appendBuffer support#342
Conversation
Agent-Logs-Url: https://github.com/wang-bin/fvp/sessions/e88de061-ce8a-4b1a-b737-79d4db5109b8 Co-authored-by: wang-bin <785206+wang-bin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for appendBuffer in FVPControllerExtensions
Add appendBuffer() to FVPControllerExtensions
Mar 27, 2026
Agent-Logs-Url: https://github.com/wang-bin/fvp/sessions/6d96f646-9eb0-4e80-a86c-9483aa07c1ed Co-authored-by: wang-bin <785206+wang-bin@users.noreply.github.com>
Copilot
AI
changed the title
Add appendBuffer() to FVPControllerExtensions
Add FVPController class with working appendBuffer support
Mar 27, 2026
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.
appendBufferinFVPControllerExtensionsis fundamentally broken for its primary use case:_getId()readstextureId/playerId, which are only valid afterinitialize()completes — butappendBuffermust be called during initialization whileprepare()is blocked waiting for data from amdk:source.Solution:
FVPControllerclassReplaces the extension-based approach with a new
FVPController extends VideoPlayerControllerthat pre-creates the underlyingMdkVideoPlayerin the constructor, keyed by its stablenativeHandlethroughout the full lifecycle.Platform changes (
video_player_mdk.dart)_playersByHandle <int, MdkVideoPlayer>— tracks all FVP-managed players bynativeHandlefrom construction to disposal_promotedHandles <int>— O(1) set tracking which handles have been added to_playersviacreate()_nextPlayerHandle— hint set byFVPController.initialize()socreate()reuses the pre-created player instead of allocating a new onecreatePendingPlayer(),setNextPlayerHandle(),clearNextPlayerHandle(),discardPendingPlayer(),appendBufferByHandle()dispose()now cleans up_playersByHandleand_promotedHandlesappendBuffer(playerId, ...)overloadController changes (
controller.dart)appendBufferfromFVPControllerExtensionsFVPControllerwith.network(),.asset(),.file()constructors,appendBuffer(), and overriddeninitialize()/dispose()Usage
appendBufferworks at all lifecycle stages — before, during, and afterinitialize().💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.