Skip to content

Conversation

@0xZOne
Copy link
Member

@0xZOne 0xZOne commented Apr 11, 2024

In the onDetachedFromEngine function, the onDestroy method should be called instead of the initialize method, even though the implementation of the two functions is no different.

  private void onDestroy() {
    // The whole FlutterView is being destroyed. Here we release resources acquired for all
    // instances
    // of VideoPlayer. Once https://github.com/flutter/flutter/issues/19358 is resolved this may
    // be replaced with just asserting that videoPlayers.isEmpty().
    // https://github.com/flutter/flutter/issues/20989 tracks this.
    disposeAllPlayers();
  }

  public void initialize() {
    disposeAllPlayers();
  }

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@0xZOne 0xZOne requested a review from camsim99 as a code owner April 11, 2024 08:23
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

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.

@stuartmorgan-g
Copy link
Collaborator

test-exempt: code refactor with no semantic change

Copy link
Collaborator

Choose a reason for hiding this comment

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

Calls

(Please see the style guide linked from the PR checklist.)

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please see the docs linked from the checklist on how to update a changelog containing NEXT.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@0xZOne 0xZOne force-pushed the main branch 2 times, most recently from 3bc9754 to 5671815 Compare April 12, 2024 01:39
@0xZOne 0xZOne requested a review from stuartmorgan-g April 12, 2024 01:42
@0xZOne 0xZOne force-pushed the main branch 4 times, most recently from 5f87caa to 6d6e815 Compare April 12, 2024 07:37
@Hixie
Copy link
Contributor

Hixie commented Apr 12, 2024

test-exempt: code refactor with no semantic change

Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

LGTM

@0xZOne 0xZOne added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 16, 2024
@auto-submit auto-submit bot merged commit b2bd8e5 into flutter:main Apr 16, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 16, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 16, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 16, 2024
flutter/packages@6698b2d...90c876d

2024-04-16 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.24.10 to 3.25.0 (flutter/packages#6545)
2024-04-16 31859944+LongCatIsLooong@users.noreply.github.com [CupertinoIcons] fix broken icons and vertical alignment, bump the version to 1.08 (flutter/packages#6520)
2024-04-16 26625149+0xZOne@users.noreply.github.com [video_player] Calls `onDestroy` instead of `initialize` in onDetachedFromEngine (flutter/packages#6501)
2024-04-15 mikemcguiness@protonmail.com [image_picker] Adopt code excerpts in README (flutter/packages#5523)
2024-04-15 mdebbar@google.com [url_launcher][web] Link should work when triggered by keyboard (flutter/packages#6505)
2024-04-15 engine-flutter-autoroll@skia.org Manual roll Flutter from 53cba24 to 2e748e8 (19 revisions) (flutter/packages#6541)
2024-04-15 stuartmorgan@google.com Update local_auth_android minSdkVersion to 19 (flutter/packages#6537)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@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
gilnobrega pushed a commit to gilnobrega/flutter that referenced this pull request Apr 22, 2024
flutter/packages@6698b2d...90c876d

2024-04-16 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.24.10 to 3.25.0 (flutter/packages#6545)
2024-04-16 31859944+LongCatIsLooong@users.noreply.github.com [CupertinoIcons] fix broken icons and vertical alignment, bump the version to 1.08 (flutter/packages#6520)
2024-04-16 26625149+0xZOne@users.noreply.github.com [video_player] Calls `onDestroy` instead of `initialize` in onDetachedFromEngine (flutter/packages#6501)
2024-04-15 mikemcguiness@protonmail.com [image_picker] Adopt code excerpts in README (flutter/packages#5523)
2024-04-15 mdebbar@google.com [url_launcher][web] Link should work when triggered by keyboard (flutter/packages#6505)
2024-04-15 engine-flutter-autoroll@skia.org Manual roll Flutter from 53cba24 to 2e748e8 (19 revisions) (flutter/packages#6541)
2024-04-15 stuartmorgan@google.com Update local_auth_android minSdkVersion to 19 (flutter/packages#6537)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@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
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
…dFromEngine (flutter#6501)

In the `onDetachedFromEngine` function, the `onDestroy` method should be called instead of the `initialize` method, even though the implementation of the two functions is no different.

```java
  private void onDestroy() {
    // The whole FlutterView is being destroyed. Here we release resources acquired for all
    // instances
    // of VideoPlayer. Once flutter/flutter#19358 is resolved this may
    // be replaced with just asserting that videoPlayers.isEmpty().
    // flutter/flutter#20989 tracks this.
    disposeAllPlayers();
  }

  public void initialize() {
    disposeAllPlayers();
  }
```
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 p: video_player platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants