Skip to content

Conversation

stuartmorgan-g
Copy link
Collaborator

Cleans up the tech debt of having two different methods of generating player IDs on Andoird, as was recently done on iOS. The current code was a result of adding non-texture-based players without refactoring the Dart<->Java communication, and relied on knowing that the engine assigned texture IDs by increasing an incrementing value. This fully separates texture IDs from player IDs, so that the plugin can fully control player ID management without relying on engine internals.

This also brings the Android and iOS implementations into better alignment, so that they don't have differences that aren't related to the platforms themselves.

Follow-up to work done for flutter/flutter#86613 Prep for flutter/flutter#172763

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Cleans up the tech debt of having two different methods of generating
player IDs on Andoird, as was recently done on iOS. The current code was
a result of adding non-texture-based players without refactoring the
Dart<->Java communication, and relied on knowing that the engine
assigned texture IDs by increasing an incrementing value. This fully
separates texture IDs from player IDs, so that the plugin can fully
control player ID management without relying on engine internals.

This also brings the Android and iOS implementations into better
alignment, so that they don't have differences that aren't related to
the platforms themselves.

Follow-up to work done for flutter/flutter#86613
Prep for flutter/flutter#172763
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a well-executed refactoring of the Android video player implementation. It successfully decouples player IDs from texture IDs by introducing separate creation methods for platform views and texture views in the Pigeon API. This change simplifies the logic, removes technical debt, and brings the Android code into closer alignment with the iOS implementation. The refactoring is consistently applied across the native Java code, Dart plugin code, and tests, resulting in a cleaner and more maintainable codebase.

@@ -1,3 +1,7 @@
## 2.8.14

* Restructures internal logic for player creation and tracking.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current changelog entry is a bit generic. To better inform developers about this significant and beneficial refactoring, consider making the description more specific. A more descriptive entry will help users quickly understand the value of this update.

Suggested change
* Restructures internal logic for player creation and tracking.
* Separates player IDs from texture IDs on Android, simplifying internal player creation and tracking.

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

Successfully merging this pull request may close these issues.

1 participant