Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[video_player] set message handler to nil on detach from engine #2814

Closed
wants to merge 4 commits into from

Conversation

cg021
Copy link
Contributor

@cg021 cg021 commented Jun 4, 2020

Description

Allow message handler to be set to nil when detachFromEngineForRegistrar is called in FLTVideoPlayerPlugin.m on iOS. Method call handlers are already set to null on Android when onDetachedFromEngine is called. This behavior was commented out as a temporary patch before setting message handlers to nil when detaching from a dying engine was allowed in the flutter engine. It should be reintroduced to the plugin since the fix is in the engine.

Related Issues

flutter/flutterfire_temporary#15, flutter/flutter#57151, flutter/engine#18428, #2759

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • 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 signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@cg021 cg021 requested a review from blasten June 4, 2020 18:34
// This is the correct behavior we never did it in the past and the engine
// doesn't currently support it.
// FLTVideoPlayerApiSetup(registrar.messenger, nil);
FLTVideoPlayerApiSetup(registrar.messenger, nil);
Copy link

Choose a reason for hiding this comment

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

It doesn't look like 57151 landed on stable yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So 2759 isn't an appropriate workaround? Since 57151 is on master but not stable, would conditionally setting the messageHandler to nil if not on stable work (i.e. calling flutter channel using NSTask and storing the active channel in an NSString to make this check)?

Choose a reason for hiding this comment

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

do you know if 57151 is already on stable v1.20.2?

@dannyvalentesonos
Copy link

@gaaclarke Can this get in now?

@gaaclarke
Copy link
Member

flutter/engine#18428 was brought over in this roll flutter/flutter@f64f6e2

So, it's on stable.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

Please rebase to resolve the conflicts, otherwise lgtm.

Copy link
Member

@Salakar Salakar left a comment

Choose a reason for hiding this comment

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

LGTM, pending changelog/pubspec updates

@google-cla
Copy link

google-cla bot commented Jan 14, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Jan 14, 2021
@Salakar
Copy link
Member

Salakar commented Jan 14, 2021

@googlebot I fixed it.

@google-cla
Copy link

google-cla bot commented Jan 14, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@Salakar
Copy link
Member

Salakar commented Jan 14, 2021

@googlebot I consent.

@google-cla
Copy link

google-cla bot commented Jan 14, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@Salakar
Copy link
Member

Salakar commented Jan 14, 2021

@cg021 I have a feeling your CLA is no longer valid - could you check?

Copy link
Contributor

@russellwheatley russellwheatley left a comment

Choose a reason for hiding this comment

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

LGTM

@cyanglaz
Copy link
Contributor

looks like @cg021's CLA is no longer valid. Can we close this PR and open another one with valid CLA?

cc @blasten

@blasten blasten closed this Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants