[video_player_avfoundation] Route video over AirPlay - #12490
Conversation
`usesExternalPlaybackWhileExternalScreenIsActive` defaults to NO, so an AVPlayer keeps the picture on the device whenever an external screen is active. Selecting an AirPlay route therefore moved only the audio, while the receiver showed a mirrored copy of the screen rather than playing the stream itself. `allowsExternalPlayback` already defaults to YES, so the two together were incoherent: external playback was permitted but never used. AVKit's own AVPlayerViewController routes to AirPlay out of the box; this brings the plugin in line with it. Verified on an Apple TV from iOS 26.6.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request configures the AVPlayer on iOS to route video over AirPlay when an external screen is active by setting allowsExternalPlayback and usesExternalPlaybackWhileExternalScreenIsActive to true. It also adds a unit test to verify these properties and bumps the package version to 2.12.0. There are no review comments, and I have no feedback to provide.
usesExternalPlaybackWhileExternalScreenIsActivedefaults to NO, so an AVPlayer keeps the picture on the device whenever an external screen is active. Selecting an AirPlay route therefore moved only the audio, while the receiver showed a mirrored copy of the screen rather than playing the stream itself.allowsExternalPlaybackalready defaults to YES, so the two together were incoherent: external playback was permitted but never used. AVKit's own AVPlayerViewController routes to AirPlay out of the box; this brings the plugin in line with it.Verified on an Apple TV from iOS 26.6.
Fixes: flutter/flutter#191227
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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