Skip to content

Conversation

@mbcorona
Copy link
Member

@mbcorona mbcorona commented Feb 9, 2026

Fixed a regression in 2.9.1 where httpHeaders were ignored on iOS.

Fixes flutter/flutter#182015

The Fix:
Updated FVPAVFactory.m to use [AVURLAsset URLAssetWithURL:options:] instead of [AVAsset assetWithURL:]. The previous implementation dropped the options dictionary containing the headers.

Verification:
Verified manually with Wireshark.

  • 2.9.1: Headers missing.
  • 2.9.2 (Fix): Headers present.

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under.
  • All existing and new tests are passing.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@google-cla
Copy link

google-cla bot commented Feb 9, 2026

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.

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 successfully addresses a regression in video_player_avfoundation where HTTP headers were being ignored. The core change correctly utilizes AVURLAsset URLAssetWithURL:options: to ensure that HTTP headers are properly passed, restoring the expected functionality. The CHANGELOG.md and pubspec.yaml files have been updated to reflect this important fix and version bump.

- (NSObject<FVPAVAsset> *)URLAssetWithURL:(NSURL *)URL
options:(nullable NSDictionary<NSString *, id> *)options {
return [[FVPDefaultAVAsset alloc] initWithAsset:[AVAsset assetWithURL:URL]];
return [[FVPDefaultAVAsset alloc] initWithAsset:[AVURLAsset URLAssetWithURL:URL options:options]];

Choose a reason for hiding this comment

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

high

This change correctly resolves the regression by using AVURLAsset URLAssetWithURL:options: instead of AVAsset assetWithURL:. This ensures that HTTP headers are properly passed to the asset, which is a critical fix for the player's functionality when dealing with authenticated or custom header-dependent streams.

@stuartmorgan-g
Copy link
Collaborator

test-exempt: currently infeasible to test

Unfortunately we don't have a good way to test this:

  • This is the intentionally-minimal wrapper (it's supposed to be a direct passthrough, and wasn't only because of a mistake) that's replaced during unit tests to make everything else testable, so isn't part of normal unit tests.
  • We can't meaningfully unit test the wrapper because the returned object isn't inspectable (e.g., we can't actually check that the options were set)
  • Ideally we would integration test that headers work, but that requires a local server (like what we do with webview_flutter integration tests with a local web server) that serves video responses, and my previous attempts to get that working failed.

This is very low risk for regression, since this code is never intended to change; it should be an absolutely minimal wrapper of the underlying API, and the initial regression was only because it was wrong in the initial PR (due to a mistake in incremental work while I was creating the PR). Given that, and that we don't currently have a mechanism for testing it, I'm exempting it.

@stuartmorgan-g
Copy link
Collaborator

This will just need a CLA to proceed.

Copy link
Contributor

@LouiseHsu LouiseHsu left a comment

Choose a reason for hiding this comment

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

LGTM once CLA is signed.

@mbcorona mbcorona force-pushed the fix/ios-headers-regression branch from 427b1d3 to 56694b6 Compare February 11, 2026 20:33
@stuartmorgan-g
Copy link
Collaborator

FYI, even once you sign the CLA you will probably need to fix some local git configuration, rewrite the commit, and force-push. Currently the CLA check is showing a @Brunos-MacBook-Pro.local address for the commit author, which isn't going to match the signed CLA.

@mbcorona mbcorona force-pushed the fix/ios-headers-regression branch from 56694b6 to e29ca8e Compare February 11, 2026 20:58
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.

http headers in iOS are not being sent

4 participants