Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception on initialize with wrong YouTube video ID #49

Closed
emersonsiega opened this issue Jul 27, 2022 · 3 comments
Closed

Unhandled exception on initialize with wrong YouTube video ID #49

emersonsiega opened this issue Jul 27, 2022 · 3 comments

Comments

@emersonsiega
Copy link
Contributor

We have a scenario where we receive YouTube video IDs from an API. These IDs is manually inserted by our marketing team. As it's a manually process, errors can happens.

With that in mind, I was trying to test how the pod_player handle a wrong YouTube video ID, and I saw that the initialize method never finishes (in pod_player_controller.dart).

The initialize stuck because a postFrameCallback is fired inside this method. This postFrame receive an exception that is not correctly handled. While this happens, the _checkAndWaitTillInitialized continues in loop, waiting until the _ctr.controllerInitialized returns true, what never happens.

I tried to put a listener and wait for a status of error, but nothing os sent to that listener...
I'll make a fork of this project and resolve this locally. If it's ok, I'll send a PR with that fix.

@emersonsiega
Copy link
Contributor Author

As I don't know the sources deeply, I'll simply rethrow this exception correctly, so, whoever calls initialise method will be able to handle this in a better way.

@emersonsiega
Copy link
Contributor Author

Solved.

@jrpursuiteam
Copy link

Hi, I am still experiencing this issue with 0.2.0. I cant upgrade to 0.2.1 due to dependency conflict. However, I see others reported on below stackoverflow link with 0.2.1 as well. Is anyone tried recently. I tried simple example code given on the documentation.

https://stackoverflow.com/questions/76976791/flutter-pod-player-shows-error-while-playing-video-message
https://stackoverflow.com/questions/74253230/flutter-pod-player-exception-videoquality-cannot-be-empty
https://stackoverflow.com/questions/76899225/error-while-playing-video-in-flutter-pod-player

flutter: PlatformException(VideoError, Failed to load video: unknown error, null, null)
flutter:
#0 PodPlayerController._checkAndWaitTillInitialized (package:pod_player/src/controllers/pod_player_controller.dart:73:9)
#1 PodPlayerController._checkAndWaitTillInitialized (package:pod_player/src/controllers/pod_player_controller.dart:82:11)

#2 PodPlayerController._checkAndWaitTillInitialized (package:pod_player/src/controllers/pod_player_controller.dart:82:5)

#3 PodPlayerController.initialise (package:pod_player/src/controllers/pod_player_controller.dart:61:5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants