Skip to content

[video_player_avfoundation] Route video over AirPlay - #12490

Open
a1rwulf wants to merge 1 commit into
flutter:mainfrom
a1rwulf:seadev_airplay-external-playback
Open

[video_player_avfoundation] Route video over AirPlay#12490
a1rwulf wants to merge 1 commit into
flutter:mainfrom
a1rwulf:seadev_airplay-external-playback

Conversation

@a1rwulf

@a1rwulf a1rwulf commented Aug 17, 2026

Copy link
Copy Markdown

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.

Fixes: flutter/flutter#191227

Pre-Review Checklist

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

`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.
@google-cla

google-cla Bot commented Aug 17, 2026

Copy link
Copy Markdown

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.

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

Copy link
Copy Markdown
Contributor

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

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.

Add support for Airplay routing

1 participant