You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[video_player] Add a state event for video completion #21929
changed the title [-]inpluns/video_player How can I monitor the completion[/-][+]plugins/video_player How can I listener the completion?[/+]on Sep 17, 2018
I/flutter (28816): ══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════
I/flutter (28816): The following assertion was thrown while dispatching notifications for VideoPlayerController:
I/flutter (28816): Navigator operation requested with a context that does not include a Navigator.
I/flutter (28816): The context used to push or pop routes from the Navigator must be that of a widget that is a
I/flutter (28816): descendant of a Navigator widget.
videoPlayerController.addListener(() {
if (videoPlayerController.value.position ==
videoPlayerController.value.duration) {
// Video finished playing. Do whatever you want.
}
});
changed the title [-]plugins/video_player How can I listener the completion?[/-][+][video_player] Add a state event for video completion[/+]on Jul 9, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-]inpluns/video_player How can I monitor the completion[/-][+]plugins/video_player How can I listener the completion?[/+]yasincidem commentedon Sep 17, 2018
A solution would be something like the code below until video_player has a isEnded or isFinished method.
once10301 commentedon Sep 18, 2018
Thank you, I have another question.
once10301 commentedon Sep 18, 2018
I find another question.
in iOS this can't work.
I used
jffiorillo commentedon May 17, 2019
@once10301
Have you tried using the following listener?
I used in iOs and it worked for me...
Or you allow the user to stop the video manually?
jerryzhoujw commentedon Aug 24, 2020
You can set the
loop:false, then when it play finished, fire anotherplayif you wantloopfeature. and do the thing you want in that finished event.10 remaining items
Syed-Waleed-Shah commentedon Jun 11, 2023
Here is the simplest solution:
[-]plugins/video_player How can I listener the completion?[/-][+][video_player] Add a state event for video completion[/+]carrasc0 commentedon Aug 7, 2023
Not working, sometimes for some reason the position does not reach the end, in my case for exmaple the listener reah until here:
Position: 0:00:10.908000
duration: 0:00:11.436000
[video_player] isCompleted event. (#4923)
github-actions commentedon Oct 2, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[video_player] isCompleted event. (flutter#4923)
[video_player] isCompleted event. (flutter#4923)