youtube_player_flutter
youtube_player_flutter copied to clipboard
On Dispose session seems to be active when user try to play new video get error.
Describe the bug On Dispose session seems to be active when user try to play new video get error.
To Reproduce Steps to reproduce the behavior: 1 - Call API from different page by passing youtube id 2 - Hit go back to go to youtube playlist and choose different id. 3 - After coming back to play screen it throws below error.
Error: Bad state: Cannot add new events after calling close at Object.throw_ [as throw] (http://localhost:60937/dart_sdk.js:4463:11) at _AsyncBroadcastStreamController.new.add (http://localhost:60937/dart_sdk.js:31128:55) at controller.YoutubePlayerController.new.add (http://localhost:60937/packages/youtube_player_iframe/src/helpers/youtube_value_builder.dart.lib.js:827:32) at http://localhost:60937/packages/youtube_player_iframe/src/helpers/youtube_value_builder.dart.lib.js:426:31 at Object._checkAndCall (http://localhost:60937/dart_sdk.js:4673:16) at Object.dcall (http://localhost:60937/dart_sdk.js:4678:17)
Expected behavior Dispose should clear session.
Screenshots If applicable, add screenshots to help explain your problem.
Technical Details:
- Device: Chrome (web)
Additional context Video still plays but it keeps login error..
I have the same problem. Could this be solved using YoutubePlayerControllerProvider?
Using one controller for all the widgets and never closing it?
Anything new on this?
@sarbagyastha Did you have a chance to look into this?
Let me know how I could help.
@nstrelow Isn't this fixed with the new update ?
no. same problem on web with 1.1.0 update as well.
View the page with youtube link, then go back and come back or go to next youtube page.
Error: Bad state: Cannot add new events after calling close
at Object.throw_ [as throw] (http://localhost:45583/dart_sdk.js:4322:11)
at _AsyncBroadcastStreamController.new.add (http://localhost:45583/dart_sdk.js:31061:55)
at controller.YoutubePlayerController.new.add (http://localhost:45583/packages/youtube_player_iframe/src/helpers/youtube_value_builder.dart.lib.js:820:32)
at http://localhost:45583/packages/youtube_player_iframe/src/helpers/youtube_value_builder.dart.lib.js:423:29
at Object._checkAndCall (http://localhost:45583/dart_sdk.js:4532:16)
at Object.dcall (http://localhost:45583/dart_sdk.js:4537:17)
at http://localhost:45583/dart_sdk.js:104668:21
I also have this issue.
Any update on this? I am using multiple youtube videos on a single page and I don't know after updating the package from 1.1.0 to 2.2.2, it started giving the mentioned error.
Bad state: Cannot add new events after calling close
at Object.throw_ [as throw] (http://0.0.0.0:55556/dart_sdk.js:5391:11)
at _AsyncBroadcastStreamController.new.add (http://0.0.0.0:55556/dart_sdk.js:36356:55)
at controller.YoutubePlayerController.new.add (http://0.0.0.0:55556/packages/youtube_player_iframe/src/helpers/youtube_value_builder.dart.lib.js:1039:33)
at http://0.0.0.0:55556/packages/youtube_player_iframe/src/helpers/youtube_value_builder.dart.lib.js:541:33
at Object._checkAndCall (http://0.0.0.0:55556/dart_sdk.js:5603:16)
at Object.dcall (http://0.0.0.0:55556/dart_sdk.js:5608:17)
at http://0.0.0.0:55556/dart_sdk.js:115918:21
Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-arm, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.65.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
Has there been a solution to this issue? I'm having the same problem!
@Danielelkhal Which version are you using ?
Version 3.0.3
@Danielelkhal Can you provide a reproducible code ?