mod: 播放器实例销毁、页面层级

This commit is contained in:
guozhigq
2023-08-14 17:54:22 +08:00
parent 5600ab5203
commit 9b7d6d105a
4 changed files with 30 additions and 80 deletions

View File

@ -678,11 +678,13 @@ class PlPlayerController {
videoFitChangedTimer?.cancel();
}
Future<void> dispose() async {
Future<void> dispose({String type = 'single'}) async {
// 每次减1最后销毁
_playerCount.value -= 1;
if (playerCount.value > 0) {
return;
if (type == 'single') {
_playerCount.value -= 1;
if (playerCount.value > 0) {
return;
}
}
_timer?.cancel();