chudongvip / awesome_video_player

This is a flutter package of video player. it's a very simple and easy to use.
MIT License
196 stars 36 forks source link

video ended fill problem #41

Closed gulmensedat closed 4 years ago

gulmensedat commented 4 years ago

how can we fix the image gets stuck on the screen when the video ends?

chudongvip commented 4 years ago

how can we fix the image gets stuck on the screen when the video ends?

you can make the video position to zero.

like this:

            /// 视频初始化完成回调
            oninit: (controller) {
              print("video oninit");
              if (controller == null) {
                controller = controller;
              }
            },
            /// 视频播放回调
            onplay: (value) {
              print("video played");
            },
            /// 视频暂停回调
            onpause: (value) {
              print("video paused");
            },
            /// 视频播放结束回调
            onended: (value) {
              print("video ended");
              controller.seekTo(Duration(seconds: 0));
            },
gulmensedat commented 4 years ago

onended: (value) { print("video ended"); controller.seekTo(Duration(seconds: 0)); },

controller.seekTo(Duration(seconds: 0));

there is a problem

Screenshot_114

image image

chudongvip commented 4 years ago

onended: (value) { print("video ended"); controller.seekTo(Duration(seconds: 0)); },

controller.seekTo(Duration(seconds: 0));

there is a problem

Screenshot_114

image image

Did you create the variable controller on this page?

gulmensedat commented 4 years ago

no I could not find?

chudongvip commented 4 years ago

no I could not find?

you can find it in the onint callback.

gulmensedat commented 4 years ago

no I could not find?

you can find it in the onint callback.

It gets 0 okay but it doesn't work for me. The video size changes as soon as the video ends. I want to make BoxFit.contain. While watching the video, it should be the same size as it ends. When the video is over, the duration of the video and whatever time it is found should write.