newtaDev / pod_player

Video player for flutter web & mobile devices, Play video from youtube or vimeo or network in flutter using pod player
https://pub.dev/packages/pod_player
MIT License
106 stars 202 forks source link

"PodGetXVideoController" not found Error #168

Open IdemenB opened 11 months ago

IdemenB commented 11 months ago

Hi,

After pressing the "full-screen button" I receive the following error. I am 80% sure (was not fully tested earlier) that before recent Flutter updates, this was running in the app, but now it breaks. Any ideas?

The following message was thrown while finalizing the widget tree:
"PodGetXVideoController" not found. You need to call "Get.put(PodGetXVideoController())" or "Get.lazyPut(()=>PodGetXVideoController())"
r-dev-limited commented 7 months ago

I saw the same error in sentry logs, any ideas ?

xurc commented 6 months ago

The same error on Android, only in the release build (it is not reproduced in debug). If there are several players on the screen with different URLs. The error occurs immediately, without clicking on the full screen. It seems that the error appeared after upgrading flutter to 3.22.

  void _setController() => mounted
      ? setState(() => controller = PodPlayerController(
            playVideoFrom: PlayVideoFrom.youtube(
              widget.source,
              live: widget.live ||
                  widget.source.contains('live=1') ||
                  widget.source.contains('/live/'),
              videoPlayerOptions: VideoPlayerOptions(
                mixWithOthers: true,
                allowBackgroundPlayback: true,
              ),
            ),
            podPlayerConfig: PodPlayerConfig(autoPlay: isLive),
          )..initialise())
      : null;

  @override
  void initState() {
    _setController();
    super.initState();
  }
xurc commented 6 months ago

@newtaDev

Looks like the problem is here: https://github.com/newtaDev/pod_player/blob/f3ea20e044d50bac6f35ac408edd65276f534540/lib/src/controllers/pod_player_controller.dart#L32

At a minimum, flutter 3.22 in release builds produces a static String "Instance of UniqueKey" with this code. Perhaps this is a flutter bug, not sure.

I changed it locally to uuid, the problem disappeared. Who has the same problem, as a temporary solution, you can indicate the following:

dependency_overrides:
  pod_player:
    git:
      url: https://github.com/xurc/pod_player.git
      ref: fix/getTag-uniqueness

I didn’t do PR because I’m not sure it’s the right solution.

furkankurt commented 5 months ago

@newtaDev

Looks like the problem is here:

https://github.com/newtaDev/pod_player/blob/f3ea20e044d50bac6f35ac408edd65276f534540/lib/src/controllers/pod_player_controller.dart#L32

At a minimum, flutter 3.22 in release builds produces a static String "Instance of UniqueKey" with this code. Perhaps this is a flutter bug, not sure.

I changed it locally to uuid, the problem disappeared. Who has the same problem, as a temporary solution, you can indicate the following:

dependency_overrides:
  pod_player:
    git:
      url: https://github.com/xurc/pod_player.git
      ref: fix/getTag-uniqueness

I didn’t do PR because I’m not sure it’s the right solution.

Same problem, fixed with the @xurc solution. Thanks 👍🏻