-
Notifications
You must be signed in to change notification settings - Fork 842
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
Next Video Playing, State change #108
Comments
I'll look into it. |
Fixed in Version 6.0.0. |
I had tested on 6.0.0 and player state stoped is called instead of ended when player reach end. Should I change to check stoped state instead of ended state? |
Once video ends, ended is fired once, then it switches to stopped. So, you might want to listen for ended, because stopped could be fired multiple times if parent state changes. |
I tried to print playerState to see if ended will be fired.
but no ended is called or updated in listener. Below is list of state that updated.
|
It's weird, the state shouldn't switch to stopped unless ended is triggered. |
ended is being called once, but when placing |
@amangautam1 Please attach logs for the UI crash. |
this is my listener. and these are logs.
|
@amangautam1 Which version of the package are you using ? |
@sarbagyastha I am using version ^6.0.0 |
@amangautam1 can you provide me with sample app so that i can reproduce and test the issue ? |
@sarbagyastha I have sent you the sample app on gmail. Please check it. |
@amangautam1 Thank you! There seems to be weird behaviour while listening to ended state. It's being called multiple times though console outputs only once. I'll be pubslishing fix for it tomorrow. |
@amangautam1 Added YoutubePlayer(
... ,
onEnded: (_){
controller.load(NEXT_VIDEO);
}
), Also, the example app is updated with list of videos being played after video end events. |
Hi,
I need to play random video from a playlist. In the listener method, I can catch endstate and generate random video from a playlist. But PlayerState doesn't pass to playing state.
MY CODE SNIPPET:
void listener() {
if (_controller.value.playerState == PlayerState.ended ) {
....
(After trying dozens of times, automatically, gives this error:)
ERROR:
════════ Exception caught by foundation library ════════════════════════════════════════════════════
The following StackOverflowError was thrown while dispatching notifications for YoutubePlayerController:
Stack Overflow
The text was updated successfully, but these errors were encountered: