abdelaziz-mahdy / flutter_meedu_videoplayer

Cross-Platform Video Player for flutter
https://abdelaziz-mahdy.github.io/flutter_meedu_videoplayer/
MIT License
132 stars 69 forks source link

about onDoubleTap play and pause question #159

Closed JieNengi closed 10 months ago

JieNengi commented 10 months ago

I try to do this,,,,,,,,,,,,It's does't work. MeeduVideoPlayer( controller: _controller, **videoOverlay: (context, controller, responsive) => GestureDetector( onDoubleTap: () { print('onDoubleTap play and pause'); if (controller.playerStatus.playing) { controller.pause(); } else { controller.play(); } }, child: Container( width: Get.width, height: Get.height, color: Colors.transparent, ),** ), )

abdelaziz-mahdy commented 10 months ago

I try to do this,,,,,,,,,,,,It's does't work. MeeduVideoPlayer( controller: _controller, **videoOverlay: (context, controller, responsive) => GestureDetector( onDoubleTap: () { print('onDoubleTap play and pause'); if (controller.playerStatus.playing) { controller.pause(); } else { controller.play(); } }, child: Container( width: Get.width, height: Get.height, color: Colors.transparent, ),** ), )

Can you show me the full code??

JieNengi commented 10 months ago

I try to do this,,,,,,,,,,,,It's does't work. MeeduVideoPlayer( controller: _controller, **videoOverlay: (context, controller, responsive) => GestureDetector( onDoubleTap: () { print('onDoubleTap play and pause'); if (controller.playerStatus.playing) { controller.pause(); } else { controller.play(); } }, child: Container( width: Get.width, height: Get.height, color: Colors.transparent, ),** ), )

Can you show me the full code??

image

abdelaziz-mahdy commented 10 months ago

My only guess is the controls gesture detector is the one overriding your touch

Does disabling the player controls make the gesture detector work? If yes I may have

One fix, is giving the ability to pass custom callbacks to the controller gesture detector, with the ability to disable and enable default ones (I don't like this idea, since it's confusing to most people)

Another one, is to give you an option to position your detector above the controls default one , which will cause touch overlays conflicts, like who will get the on tap and who will not

Also I did want the example with the controller to see which and what are disabled and enabled,

JieNengi commented 10 months ago

My only guess is the controls gesture detector is the one overriding your touch

Does disabling the player controls make the gesture detector work? If yes I may have

One fix, is giving the ability to pass custom callbacks to the controller gesture detector, with the ability to disable and enable default ones (I don't like this idea, since it's confusing to most people)

Another one, is to give you an option to position your detector above the controls default one , which will cause touch overlays conflicts, like who will get the on tap and who will not

Also I did want the example with the controller to see which and what are disabled and enabled,

yes,I try“controlsEnabled: false,”,code works fine . I think I'll reconstruct the controller to implement onDoubleTap play and pause. image image

abdelaziz-mahdy commented 10 months ago

My only guess is the controls gesture detector is the one overriding your touch Does disabling the player controls make the gesture detector work? If yes I may have One fix, is giving the ability to pass custom callbacks to the controller gesture detector, with the ability to disable and enable default ones (I don't like this idea, since it's confusing to most people) Another one, is to give you an option to position your detector above the controls default one , which will cause touch overlays conflicts, like who will get the on tap and who will not Also I did want the example with the controller to see which and what are disabled and enabled,

yes,I try“controlsEnabled: false,”,code works fine . I think I'll reconstruct the controller to implement onDoubleTap play and pause. image image

if you can add a pr, that will be lovely, since i cant work on it until weekend sorry for that