-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[video_player] Move more Java logic to Dart #9672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[video_player] Move more Java logic to Dart #9672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request moves video player logic from native code to Dart, improving maintainability. It also introduces an enum for video format hints. The review identifies a critical issue with a missing break
statement in a switch
block and a medium-severity issue with case-sensitive HTTP header lookup. Addressing these will improve the correctness and robustness of the code.
packages/video_player/video_player_android/lib/src/android_video_player.dart
Show resolved
Hide resolved
packages/video_player/video_player_android/lib/src/android_video_player.dart
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
flutter/packages@ed235d1...d914120 2025-07-30 [email protected] Roll Flutter from 46b097a to c3279ca (18 revisions) (flutter/packages#9699) 2025-07-29 [email protected] [video_player] Move more Obj-C logic to Dart (flutter/packages#9685) 2025-07-29 [email protected] Update CODEOWNERS (flutter/packages#9692) 2025-07-29 [email protected] [video_player] Move more Java logic to Dart (flutter/packages#9672) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Moves some logic from native code to Dart: - User-Agent header -> ExoPlayer user agent extraction logic (with TODOs for future improvements, based on implementation issues/questions I noticed while converting it). - Asset -> URL lookup. - Conversion of buffer position to the buffer range list required for the Dart event stream. Also converts video format hint from strings to enums, which was missed in earlier Pigeon conversions. Using strings was the pre-Pigeon way of handling this kind of thing. Part of flutter/flutter#172763 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^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.
Moves some logic from native code to Dart:
Also converts video format hint from strings to enums, which was missed in earlier Pigeon conversions. Using strings was the pre-Pigeon way of handling this kind of thing.
Part of flutter/flutter#172763
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assist
bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
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