sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
709 stars 823 forks source link

[BUG] <title> Dispose issue #990

Open Onnesok opened 1 month ago

Onnesok commented 1 month ago

Is there an existing issue for this?

Package

youtube_player_iframe (Default)

What happened?

on video player screen pop video player still stays for some time.... Disposing taking longer time....

  @override
  void dispose() async {
    if (_controller.value.isFullScreen) {
      _controller.toggleFullScreenMode();
    } else {
      await Future.delayed(const Duration(milliseconds: 200));
      _controller.dispose();
    }

    SystemChrome.setPreferredOrientations([
      DeviceOrientation.portraitUp,
      DeviceOrientation.landscapeLeft,
      DeviceOrientation.landscapeRight,
    ]);

    super.dispose();
  }

What is the expected behaviour?

Pop with other screens not after.....

How to reproduce?

on pop return to another page

Flutter Doctor Output

_dependents.isEmpty
lukiholzi commented 6 days ago

Any updates on this? I have the same problem.