Repository navigation
VideoPlayer plugin should make sure that resources are released when FlutterView is destroyed #20989
Copy link
Copy link
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)p: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Activity
- addedc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)
on Aug 24, 2018 - added 6 commits that reference this issue
on Aug 24, 2018 - added a commit that references this issue
on Aug 27, 2018 - added a commit that references this issue
on Sep 6, 2018 - added a commit that references this issue
on Feb 17, 2019 - added a commit that references this issue
on Sep 29, 2019 9 remaining items
- addedP3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectand removed
on Jun 28, 2023 - addedpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
on Jul 5, 2023 - addedteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
on Jul 8, 2023 - added a commit that references this issue
on Apr 16, 2024 - added a commit that references this issue
on May 22, 2024 - added a commit that references this issue
on May 24, 2024 - added a commit that references this issue
on Jun 10, 2026 - added a commit that references this issue
on Jun 19, 2026
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)p: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
This is related to #19206 and #19358.
VideoPlayerplugin on Android allocates a platformMediaPlayerobject for eachVideoPlayerplugin in the widget tree.MediaPlayerobjects are destroyed when corresponding Flutter widgets go away. But if a wholeFlutterViewis destroyed,disposemethods don't run, soMediaPlayerinstances are not released. This leads to leaks and also crashes (since the player continues to provide frames for non-existent surfaces; internal bug: b/112692333).IMO,
VideoPlayershould rely on normal disposing for the final cleanup and just assert that by the time the view is destroyed all resources are released. This would rely on widgets disposal methods to be called, which is tracked in #19358.As a workaround,
VideoPlayershould subscribe with aonViewDestroyListenerand explicitly release all resources when the ownerFlutterViewgoes away.