Skip to content

[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

Merged

Conversation

stuartmorgan-g
Copy link
Contributor

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. 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

  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

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

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.

@stuartmorgan-g stuartmorgan-g changed the title [video_player] Move more logic to Dart [video_player] Move more Java logic to Dart Jul 28, 2025
Copy link
Contributor

@ash2moon ash2moon left a comment

Choose a reason for hiding this comment

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

LGTM!

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2025
@auto-submit auto-submit bot merged commit 733d1cb into flutter:main Jul 29, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 30, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jul 30, 2025
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
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: video_player platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants