Sitelet https://github.com/flutter/packages/pull/12490
Skip to content

[video_player_avfoundation] Route video over AirPlay - #12490

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
a1rwulf:seadev_airplay-external-playback
Sep 4, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:mainfrom
a1rwulf:seadev_airplay-external-playback

Conversation

@a1rwulf

@a1rwulf a1rwulf commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

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

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

@a1rwulf

a1rwulf commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for kicking of the review process.
I found this limitation while working on casting support for chewie, just to give some more context on why I would need this fix.
If hardcoding is a bad idea for whatever reason, it would involve more work and probably a video_player interface change to enable opt-in/out of those flags.

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

Seems reasonable change to default to the same behavior as AVPlayer. If later we need to change the value, we can provide an API to do so.

@hellohuanlin hellohuanlin added the CICD Run CI/CD label Aug 20, 2026

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

lgtm!

@a1rwulf

a1rwulf commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

How is conflict handling in the changelog done, do I need to resolve it - or will it be taken care of when a release happens?

@LouiseHsu

Copy link
Copy Markdown
Contributor

How is conflict handling in the changelog done, do I need to resolve it - or will it be taken care of when a release happens?

you need to resolve it otherwise this pr cant merge :)

`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.
@a1rwulf
a1rwulf force-pushed the seadev_airplay-external-playback branch from eed3d2b to e7eefcf Compare September 1, 2026 19:37
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 1, 2026
@a1rwulf

a1rwulf commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Conflict fixed.
Went for a minor bump instead of patch (it also was a minor bump in the original version), because it's a change in behavior for users.

@a1rwulf

a1rwulf commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Can somebody add the ci label again so we can get this merged?

@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 3, 2026
@vashworth vashworth added the CICD Run CI/CD label Sep 3, 2026
@auto-submit
auto-submit Bot merged commit ca4072e into flutter:main Sep 4, 2026
13 checks passed
pull Bot pushed a commit to Mattlk13/flutter that referenced this pull request Sep 9, 2026
…er#192485)

flutter/packages@9af9c60...36e088a

2026-09-09 daniel.leon@cloudsufi.com [quick_actions] Adopt code-excerpts
for README (flutter/packages#12643)
2026-09-08 65155920+0xharkirat@users.noreply.github.com [camera_web] Fix
TypeError when reading the torch capability (flutter/packages#12647)
2026-09-08 gibbonsj97@gmail.com [google_maps_flutter_web] Avoid
replacing advanced marker content on move (flutter/packages#11952)
2026-09-08 mit@google.com [material_ui][cupertino_ui] Change issue
tracker label in pubspec.yaml (flutter/packages#12792)
2026-09-08 saurabhmirajkar000@gmail.com [material_ui] Fix FilledButton
Material 3 default style docs (flutter/packages#12620)
2026-09-08 21270878+elliette@users.noreply.github.com [infra] Use a
modified no-response workflow in flutter/packages
(flutter/packages#12745)
2026-09-08 21270878+elliette@users.noreply.github.com [material_ui]
Migrate M3 Banner template to use new gen_defaults
(flutter/packages#12734)
2026-09-08 engine-flutter-autoroll@skia.org Roll Flutter from
63170e9 to b444e78 (13 revisions) (flutter/packages#12791)
2026-09-08 fluttergithubbot@gmail.com Sync release-go_router-18.0.1 to
main (flutter/packages#12725)
2026-09-08 fluttergithubbot@gmail.com Sync release-material_ui-1.1.1 to
main (flutter/packages#12726)
2026-09-08 stuartmorgan@google.com [tool] Adopt `platform` 3.2.0
(flutter/packages#12789)
2026-09-07 50643541+Mairramer@users.noreply.github.com [material_ui] Fix
SliverGeometry maxPaintExtent assertion in CarouselView.weighted
(flutter/packages#12563)
2026-09-05 engine-flutter-autoroll@skia.org Roll Flutter from
5a6cfa7 to 63170e9 (15 revisions) (flutter/packages#12767)
2026-09-04 engine-flutter-autoroll@skia.org Manual roll Flutter from
70797e1 to 5a6cfa7 (52 revisions) (flutter/packages#12760)
2026-09-04 brackenavaron@gmail.com [material_ui] port drawer tests over
from flutter/widgets (flutter/packages#12711)
2026-09-04 tarrinneal@gmail.com add cooldown (flutter/packages#12708)
2026-09-04 joeldumasbg@gmail.com [in_app_purchase] Support StoreKit 2
introductory offer eligibility JWS (flutter/packages#12584)
2026-09-04 21270878+elliette@users.noreply.github.com [material_ui]
Migrate M3 Badge template to use new gen_defaults
(flutter/packages#12733)
2026-09-04 stuartmorgan@google.com [google_maps_flutter] Convert heatmap
controller to Swift (flutter/packages#12713)
2026-09-04 97480502+b-luk@users.noreply.github.com [material_ui] Remove
unused `maintainState` constructor parameter in `scaffold_test.dart`
(flutter/packages#12754)
2026-09-04 a1rwulf@users.noreply.github.com [video_player_avfoundation]
Route video over AirPlay (flutter/packages#12490)
2026-09-04 jerome.dellamaria@proton.me [google_fonts] Add
google_fonts_lite file to allow tree-shaking of the other huge files
(flutter/packages#11433)
2026-09-04 engine-flutter-autoroll@skia.org Roll Flutter from
0cbd1a4 to 70797e1 (27 revisions) (flutter/packages#12727)
2026-09-04 stuartmorgan@google.com Update Chrome for stable tests
(flutter/packages#12747)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com 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
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
`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

**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.
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
`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

**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 CICD Run CI/CD p: video_player platform-ios platform-macos triage-ios Should be looked at in iOS triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Airplay routing

6 participants