Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Replaces the code that used the key window's root view controller with a call to the new registrar viewController method to get the actual Flutter content's view controller.

Since code behind the view provider abstraction is by definition not unit testable (since that's the interface used to DI a replacement in tests), this changes the API surface so that it's a direct passthrough to the registrar method. This does add some additional ifdefing, but minor compile-time complexity is better than having additional logic behind the test injection abstraction.

Fixes flutter/flutter#174416

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

Replaces the code that used the key window's root view controller with a
call to the new registrar `viewController` method to get the actual
Flutter content's view controller.

Since code behind the view provider abstraction is by definition not
unit testable (since that's the interface used to DI a replacement in
tests), this changes the API surface so that it's a direct passthrough
to the registrar method. This does add some additional ifdefing, but
minor compile-time complexity is better than having additional logic
behind the test injection abstraction.

Fixes flutter/flutter#174416
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 updates the video_player_avfoundation plugin for UIScene compatibility by replacing the deprecated keyWindow API with registrar.viewController. The changes are correctly implemented in the native code and the tests are updated accordingly, improving compatibility with modern iOS practices. I have one suggestion to align an initializer in the test code with Objective-C best practices.

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.

[video_player_avfoundation][UIScene] Migrate to scene APIs

1 participant