-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[video_player] Move [player dispose] to onUnregistered
#2124
[video_player] Move [player dispose] to onUnregistered
#2124
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with passing tests
40ad637
to
ca7cc69
Compare
We will skip the test until we move iOS integration test to firebase device lab. @collinjackson |
SGTM. |
@fkorotkov has been looking into the video player hanging issue for flutter driver tests. Meanwhile, since it is a fix to a customer critical issue, we can land it with the skipped tests. We will un-skip it when the Cirrus issue is resolved. |
@cyanglaz BTW did you test with Xcode 10.2? I did try on 11.2.1 where I had the version error. I'll try 10.2 now. 🤔 |
The version error you emailed me seems related to the pub version script. It basically says the version in pubspec in your patch is too high compares to the version in pubspec on master. I replied your email with some thoughts about it. Please let me know if you haven't received the email, I can send it again. :D |
@cyanglaz I've removed the |
@fkorotkov Thanks that sounds great!! I have created an issue for it .flutter/flutter#43012, let's track it there :) |
@cyanglaz I am testing this fix, and After digging a little, it's because the
Yet, the video player plugin overrides it like this:
When I change it to
it works perfectly. I'm not sure why the FlutterTexture API would pass the texture pointer to itself... Anyway, this has not been fully fixed. Thanks. |
@dannyvalentesonos you are absolutely correct! Do you mind opening a PR with your fix? I will be happy to review it. Thanks. |
Description
Fix the issue where the player object is destructed before the texture finishes unregistering which leads to crashing the app.
The
onTetureUnregistered
callback is only available after flutter/engine#12695. Until this change in engine is moved to "stable", we use a temporary solution.The temporary fix delays the dispose of the FLTPlayer which avoid the race condition.
This PR also added driver test for the example app which runs the crashing scenario in flutter/flutter#41125 and makes sure it is not crashing. The test will only crash on iOS 12 and above.
Related Issues
flutter/flutter#41125
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.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?